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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: chrris at mail dot dk
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 13:01:29 2025 UTC