I got RHLE4 on my machine. php 4.3+. please help me with the problem shown below
fragment of class:
class Queue {
var $q_array = array();
function push($object) { array_push($this->q_array,$object);}
..............
}
php fragment:
<?php
$queue = new Queue;
$queue.push("1");
......................
?>
error message:
Fatal error: Call to undefined function: push() in /var/www/html/scott/run_hits.php on line 2
why my php doesnt support class?
Moderator: General Moderators
PHP uses '->' instead of '.' to signy a child method/property 
And don't forget you must have the class definition within the same environment, be it through an include or in the same file.
And don't forget you must have the class definition within the same environment, be it through an include or in the same file.
Code: Select all
$queue->push();- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland