|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-04 20:24 UTC] jj at thecloud dot org
FIRST OUTPUT:
New object
REFRESH BROWSER:
Fatal error: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition binladen of the object you are trying to operate on was loaded _before_ the session was started in test.php on line 16
Note: The class is defined before the session start!
<?php
class BinLaden{
var $wow;
function BinLaden($Parola){
$this->wow=$Parola;
}
}
session_start();
if(!isset($wa)) {
$wa = new BinLaden("Hello Word");
session_register('wa');
print "New object<br>";
} else {
echo($wa->cazz);
print "Object from session<br>";
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 03:00:01 2025 UTC |
mispelled while restyling the code for you :-) <?php class BinLaden{ var $wow; function BinLaden($Parola){ $this->wow=$Parola; } } session_start(); if(!isset($wa)) { $wa = new BinLaden("Hello Word"); session_register('wa'); print "New object<br>"; } else { echo($wa->wow); // THIS LINE WAS MISPELLED print "Object from session<br>"; } ?>