php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34629 __get must take exactly 1 argument
Submitted: 2005-09-24 18:49 UTC Modified: 2005-09-24 19:20 UTC
From: djmaze at cpgnuke dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: djmaze at cpgnuke dot com
New email:
PHP Version: OS:

 

 [2005-09-24 18:49 UTC] djmaze at cpgnuke dot com
Description:
------------
When using the PHP 4 "forward compatibility" function overload() you can use function __get($n, $val)

But when you want to use such class in PHP 5 it throws an error.

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
class Foo
{
    function __get($n, $val='')
}

if (function_exists('overload') && phpversion() < 5)
{
    overload('Foo');
}
?>

Expected result:
----------------
No errors

Actual result:
--------------
In PHP 5:
Fatal error: Method Foo::__get() must take exactly 1 argument

In PHP 4:
Works as expected

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-24 19:20 UTC] marcot@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is the way the overload extension is meant to work in PHP 4. It is not meant to be "forward compatible" and changing its behaviour now would cause BC problems.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 12:01:32 2024 UTC