Skip to content

$object::class - E_PARSE#707

Closed
ParkFramework wants to merge 4732 commits intoPHP-5.5from
master
Closed

$object::class - E_PARSE#707
ParkFramework wants to merge 4732 commits intoPHP-5.5from
master

Conversation

@ParkFramework
Copy link
Copy Markdown

PHP 5.5
When accessing the $object::class, will give E_PARSE...
This is normal behavior?

The documentation about it nothing is specified.
http://www.php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class

bor0 and others added 30 commits June 8, 2014 19:14
Show the type of the non-object for more descriptive errors
* PHP-5.6:
  Bug 64744 Show the type of the non-object for more descriptive errors
* github/pr/462:
  Bug 64744 Show the type of the non-object for more descriptive errors
* PHP-5.6:
  Removed another cvsclean file
  Removed cvsclean and svnclean tools
* github/pr/669:
  Removed another cvsclean file
  Removed cvsclean and svnclean tools
* PHP-5.5:
  add news
  Bug 49898 __getCookies() method implementation
* PHP-5.6:
  update news
  add news
  Bug 49898 __getCookies() method implementation
* PHP-5.5:
  Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
* PHP-5.6:
  Fixed DOM tests when using libxml2 versions patched against CVE-2014-0191
* PHP-5.5:
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Fixed bug #67399 (putenv with empty variable may lead to crash)
* PHP-5.6:
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Fixed bug #67399 (putenv with empty variable may lead to crash)
  Fixed bug #67399 (putenv with empty variable may lead to crash)
* PHP-5.6:
  enable phpdbg for the travis build, and also run the testsuite for it
* PHP-5.6:
  NEWS
  NEWS
  Fixed bug #67406 built-in web-server segfaults on startup
* PHP-5.5:
  NEWS
  NEWS
  Fixed Bug #67410 fileinfo: mconvert incorrect handling of truncated pascal string size
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #67410 fileinfo: mconvert incorrect handling of truncated pascal string size
* PHP-5.5:
  NEWS
  NEWS
  Fixed Bug #67411 	fileinfo: cdf_check_stream_offset insufficient boundary check
* PHP-5.6:
  NEWS
  NEWS
  NEWS
  Fixed Bug #67411 	fileinfo: cdf_check_stream_offset insufficient boundary check
Tyrael and others added 23 commits July 2, 2014 22:38
* PHP-5.5:
  adding a reproduce script for bug #49184
* PHP-5.6:
  adding a reproduce script for bug #49184
* PHP-5.6:
  update the credits
* PHP-5.6:
  also add Remi to the QA credits
  add Stas and Julient to the QA credits
* PHP-5.6:
  BFN for bug #67551 (php://input temp file will be located in sys_temp_dir instead of upload_tmp_dir)
  reorder
  restore API compatibility
  finish
  refactor php_stream_temp_create{,_ex} and use it for the php://input stream
  refactor _php_stream_fopen_{temporary_,tmp}file()
  fix length overflow of HTTP_RAW_POST_DATA

Conflicts:
	main/php_content_types.c
@ParkFramework ParkFramework changed the title $object::class - PHP_PARSE $object::class - E_PARSE Jul 4, 2014
@php-pulls
Copy link
Copy Markdown

Comment on behalf of nikic at php.net:

This does not appear to be a pull request.

@php-pulls php-pulls closed this Jul 4, 2014
@nikic
Copy link
Copy Markdown
Member

nikic commented Jul 4, 2014

$object::class is not supposed to work - ::class is there so you can get the FQCN of a name, which is a purely compile-time operation. $object::class would do something pretty different (get the class name of an object), so it was not added.

However in the future this might be introduced as an alternative to get_class($object).

@ParkFramework
Copy link
Copy Markdown
Author

Yes, is need, as an alternative to get_class($object)

@datibbaw
Copy link
Copy Markdown
Contributor

datibbaw commented Jul 5, 2014

At the very least I'd recommend to rebase your branch or create a new PR with the correct target branch.

@Majkl578
Copy link
Copy Markdown
Contributor

Majkl578 commented Jul 5, 2014

I actually think it is reasonable, it would be nice to use $object::class instead of ugly get_class($object) (it's pretty much like $object::foo() vs. ugly call_user_func($object, 'foo'). It could work in runtime in this case, or is that not possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.