You are here: Re: Global unavailable? « PHP « IT news, forums, messages
Re: Global unavailable?

Posted by Oliver Gr�tz on 10/08/05 06:48

Problem not reproducable. Test case used:

-------------------------------
a.inc.php:

<?php
$a = 123;

-------------------------------
b.inc.php:

<?php
require 'a.inc.php';
class b {
function test() {
global $a;
echo $a;
}
}

-------------------------------
t.php:

<?php
require 'b.inc.php';

$x=new b();
$x->test();

-------------------------------
Command line: php t.php
Output: 123


I used PHP-5.1 RC1. No problem whatsoever. Such problems shouldn't arise
in new versions since they are touching very basic concepts that didn't
change.

AllOLLi
____________
"You see, Mr. President: The worlds hates America. And for good reason.
(I wont bother going into details)"
[24 319]

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация