Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.
https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?
https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?
Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.
https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.
Non-string offsets do not work in strings, because they don't make sense
in strings.
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi,
Thanks for reply.
https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.
We should improve doc, it's confusing.
https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.Non-string offsets do not work in strings, because they don't make sense
in strings.
Since the result became opposite, I think it should be
noted in migration doc and array page.
I'll do that now.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
2012/3/31 Stas Malyshev smalyshev@sugarcrm.com:
Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.Non-string offsets do not work in strings, because they don't make sense
in strings.Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
在 2012年3月31日星期六,下午3:31,Stas Malyshev 写道:
Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.
If is set to false does it means the first parameter can't be string?
Can't we just make the last parameter to autoload=true|false.
if the first parameter is a string then try to find the class if not try autoloadding.
if string will not be a String Class in 5.* I think it's ok to do like this. eg: callable and many mixed paramter.
what do you think?
https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.Non-string offsets do not work in strings, because they don't make sense
in strings.Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi,
From the NEWS file :
- . Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to + is_a and is_subclass_of). (alan_k)
The 3rd argument is add to let user choose autoload or not, but not a string or not.
so maybe we can make it more clear.
--
reeze
已使用 Sparrow (http://www.sparrowmailapp.com/?sig) 发送
在 2012年3月31日星期六,下午3:58,reeze 写道:
在 2012年3月31日星期六,下午3:31,Stas Malyshev 写道:
Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.
If is set to false does it means the first parameter can't be string?
Can't we just make the last parameter to autoload=true|false.
if the first parameter is a string then try to find the class if not try autoloadding.if string will not be a String Class in 5.* I think it's ok to do like this. eg: callable and many mixed paramter.
what do you think?
https://bugs.php.net/bug.php?id=61507
This is worse than isset($str[0][0]) issue.Non-string offsets do not work in strings, because they don't make sense
in strings.Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
2012/3/31 reeze reeze.xia@gmail.com:
Hi,
From the NEWS file :
- . Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument
to- is_a and is_subclass_of). (alan_k)
The 3rd argument is add to let user choose autoload or not, but not a string
or not.so maybe we can make it more clear.
It seems 3rd parameter is used only to deny class name(string).
This certainly prevents autoloading, but I'm not sure if this is intended.
I'll read the bug report and figure out.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
This is my suggestion for is_subclass_of()
doc fix.
I've already committed. If anyone want to improve, please do.
https://gist.github.com/2260846
I would like to allow string class name always and only
prevent autoloading, but I don't care much.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
2012/3/31 reeze reeze.xia@gmail.com:
在 2012年3月31日星期六,下午3:31,Stas Malyshev 写道:
Hi Stas,
Just FYI.
Following bugs are needed to be fixed before 5.4.1, I think.https://bugs.php.net/bug.php?id=61526
Which is right, doc or code?Both. The parameter means that first argument (object) can be a string,
and if it is, it will be passed to autoloader to find the class. See bug
#55475 for the discussion.If is set to false does it means the first parameter can't be string?
Can't we just make the last parameter to autoload=true|false.
if the first parameter is a string then try to find the class if not try
autoloadding.if string will not be a String Class in 5.* I think it's ok to do like
this. eg: callable and many mixed paramter.what do you think?
You're right.
I've read too many bug reports today and confused :)
<?php
class Super {}
class Sub extends Super {}
// By default, 1st parameter may be string and treated as class name.
var_dump(is_subclass_of('Sub', 'Super')); // true
// Explicitly allow string as class name
var_dump(is_subclass_of('Sub', 'Super', true)); // true
// Do not allow string as a 1st parameter, so false.
var_dump(is_subclass_of('Sub', 'Super', false)); // false
?>
Therefore, 3rd parameter works for "Not allowing class name", but
it cannot be used to restrict autoloading.
Am I missing something? I'll read the report Stas mentioned from now.
Regards,
--
Yasuo Ohgaki
Hi!
If is set to false does it means the first parameter can't be string?
It can. But it won't be seen as a class name, but rather as a string,
that is not an object that is an instance of a subclass of anything, so
it will return false.
Can't we just make the last parameter to autoload=true|false.
if the first parameter is a string then try to find the class if not try
autoloadding.
We discussed all the solutions already and chose this one, please see
discussion on the list and the bug I've referred to. I see no point in
going through the same discussion again.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
在 2012年3月31日星期六,下午4:35,Stas Malyshev 写道:
Hi!
If is set to false does it means the first parameter can't be string?
It can. But it won't be seen as a class name, but rather as a string,
that is not an object that is an instance of a subclass of anything, so
it will return false.Can't we just make the last parameter to autoload=true|false.
if the first parameter is a string then try to find the class if not try
autoloadding.We discussed all the solutions already and chose this one, please see
discussion on the list and the bug I've referred to. I see no point in
going through the same discussion again.
Thanks for your kindly explanation and yohagaki's doc update I've got it.