Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:16:08+00:00 2026-06-15T13:16:08+00:00

I have a class: class Validator { private $validationArray; private $cleanedValues; public function __construct($arg1,

  • 0

I have a class:

class Validator {
    private $validationArray;
    private $cleanedValues;

    public function __construct($arg1, $arg2=NULL) {
        if(empty($arg2)) {
            $this->LoadValidatorByName($arg1);
        } else {
            $this->LoadValidatorFromLeadType($arg1, $arg2);
        }
    }

    private function LoadValidatorFromLeadType($lead_type, $vocabulary) {
            $ErrorReporter = new ErrorReporter;
            $taxonomy_term = reset(taxonomy_get_term_by_name($lead_type, $vocabulary));

...some more stuff

The function taxonomy_get_term_by_name is a Drupal function but the issue I am experiencing is a PHP one.

When this method is called PHP complains with:

Strict warning: Only variables should be passed by reference in Validator->LoadValidatorFromLeadType() (line 32 of [path to my file])

Line 32 is ths line with:

$taxonomy_term = reset(taxonomy_get_term_by_name($lead_type, $vocabulary));

I’ve looked in to the error and I’m pretty sure I know what it means, but I can’t understand what is wrong with my code that causes this warning.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:16:09+00:00Added an answer on June 15, 2026 at 1:16 pm

    reset is waiting for a variable reference. You are passing it a function result…

    $taxonomy_term = taxonomy_get_term_by_name($lead_type, $vocabulary);
    $taxonomy_term = reset($taxonomy_term );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this class class Validator implements iValidation{ protected $_fields, $_errors; public function __construct($fields){
Suppose I have this: class Validator { private $db; public checkIfUsernameAlreadyExists($username) { if (!$this->db)
(Java Spring WebApp) I have: public class PersonValidator implements Validator { private PersonDAO d;
I have a simple class like this, import javax.validation.constraints.NotNull; import org.hibernate.validator.constraints.Length; public class Form
I have model: [Validator(typeof(RegisterValidator))] public class RegisterModel { public string Name { get; set;
I have a class : Schedule. public class Schedule { private int locationNum; private
For example: I have a JSF Validator to validate e-mail thusly: @FacesValidator(value=validateEmail) public class
Suppose I have a class like this class A { private int _x; //must
I have one registration page which uses custom valiadtor public class CustomValidator implements Validator
I have a model class that uses a custom validator as shown in following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.