php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23273 Defining __set or __get in a class inside of a namespace undefines print_r
Submitted: 2003-04-18 10:46 UTC Modified: 2003-06-04 22:30 UTC
From: tim at timcrider dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-04-18 (dev) OS: Red Hat 8.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tim at timcrider dot com
New email:
PHP Version: OS:

 

 [2003-04-18 10:46 UTC] tim at timcrider dot com
Whenever you define a __set or __get inside of a class within a namespace seems to undefine print_r

-----[ class.php ]-----
<?php

namespace foo
{
 class bar
 {

  function __construct()
  {
  }

  function __set($k, $v)
  {
  }

  function __get($k)
  {
  }
 }
}
?>
-----[ run.php ]-----
#!/php5/bin/php -q
<?php

 require_once "class.php";
 $a = New foo::bar;

 print "Trying ".$a->testing."\n";
 $a->abc = 123;

 print_r($a);
?>
-----[ config ]-----
./configure --prefix=/php5 \
--with-gettext \
--with-gd=/usr \
--with-jpeg-dir=/usr/local \
--with-mcrypt=/usr/local \
--with-mcal=/usr/local \
--with-ming=/usr/local \
--with-mhash=/usr/local \
--with-mysql=/usr/local/mysql \
--with-zlib=/usr/local \
--with-ncurses \
--with-tiff-dir="/usr/local" \
--with-unixODBC=/usr/local/unixODBC \
--with-xml \
--with-calendar=shared \
--with-png-dir=/usr/local \
--with-freetype=/usr/local \
--with-freetype-dir=/usr/local \
--with-ttf=/usr/local \
--with-openssl=/usr/local \
--with-bz2 \
--with-dom \
--enable-bcmath \
--enable-calendar \
--enable-dio \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-shmop \
--enable-sigchild \
--enable-sockets \
--enable-track-vars \
--enable-magic-quotes \
--enable-trans-sid \
--enable-libgcc \
--enable-wddx \
--enable-sysvshm \
--enable-sysvsem \
--enable-sysvmsg

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-18 10:47 UTC] tim at timcrider dot com
-----[ output ]-----
Trying 
<br />
<b>Fatal error</b>:  Unknown function:  print_r()
 in <b>/php5/bugz/get_set/run.php</b> on line <b>10</b><br />
 [2003-06-04 22:30 UTC] sterling@php.net
Works in Cvs.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC