php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9561 @unset() causes parse error
Submitted: 2001-03-05 09:58 UTC Modified: 2001-03-06 07:00 UTC
From: chrris at mail dot dk Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
14 + 6 = ?
Subscribe to this entry?

 
 [2001-03-05 09:58 UTC] chrris at mail dot dk
The following code causes an error message:

Parse error: parse error in /home/cri/public_html/unsettest.php on line 14

<?php

error_reporting(15);

class someClass {

    var $someVar = array();

    function add($name, $val) {
	$this->someVar[$name] = $val;
    }

    function del($name) {
	return @unset($this->someVar[$name]);
    }

}


$someObj = new someClass;

$someObj->add("bike", "blue");

$someObj->del("bike");

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-06 07:00 UTC] stas@php.net
unset is an operator, not a function. @ is for functions.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 01:01:30 2024 UTC