|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-03-27 10:26 UTC] sniper@php.net
[2001-06-27 02:09 UTC] danbeck@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
<?php // // The following produces a warning // error_reporting(15); define("A", 1); define("B", 2); define("C", 3); class Example { var $hash = array(A => "test1", B => "test2", C => "test3"); var $otherHash; function Example() { $this->otherHash = array(A => "test1", B => "test2", C => "test3"); } } $example = new Example; echo "<hr>Trying \$example->hash[B]:<br>"; echo $example->hash[B]; echo "<hr>Trying \$example->otherHash[B]<br>"; echo $example->otherHash[B]; echo "<hr>Dump of \$example->hash<br>"; print_r($example->hash); echo "<hr>Dump of \$example->otherHash<br>"; print_r($example->otherHash); ?>