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 this is not your bug, you can add a comment by following this link.
If this is your bug, but 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

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 06:01:29 2024 UTC