php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34694 en error occurs when a parameter is set as FALSE
Submitted: 2005-09-30 22:16 UTC Modified: 2005-09-30 23:46 UTC
From: kropeck at interia dot pl Assigned:
Status: Not a bug Package: Variables related
PHP Version: 5.0.5 OS: Win XP
Private report: No CVE-ID: None
 [2005-09-30 22:16 UTC] kropeck at interia dot pl
Description:
------------
I have a class, where are few variables:

function DrawSelectList($list_name, $key1, $key2=false)

and there is a class which calls my function. If there are 3 variables:
$result = $class1 -> DrawSelectList($arg1, $arg2, $arg3)

there is no problem, but if I pass two arguments only, there is a problem:
PHP Fatal error:  Cannot access empty property in C:\project\ast\utility\SelectList.php on line 29

the code of 'SelectList.php' looks like this:

(...)	
while($row = $dao->fetchObject())
	{
		$this->arg1= $row->$key;
		$this->arg2= $row->$pole1;
line 29		$this->arg3= $row->$pole2;
		$this->list= $list_name;
(...)

In PHP 5.0.4 it worked properly.
Sorry for my english.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-30 23:46 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Properties are written in this way:
$this->prop
without the "$" at the beginning.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 02 03:01:30 2024 UTC