Bug 244076 - Static calling of a method of a class represented by a string is considered a syntax error
Summary: Static calling of a method of a class represented by a string is considered a...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: PHP (other bugs)
Version First Reported In: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-09 21:50 UTC by Jan Buchar
Modified: 2019-03-20 20:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Buchar 2010-07-09 21:50:38 UTC
Version:           SVN (using KDE 4.4.4) 
OS:                Linux

A class should be accessible through a variable which contains its name as a string. However, calling its method through such a variable results in the parser reporting a syntax error.

An example:
<?php
class A {
	public static function foo () {
		return "bar";
	}
}
$cls = 'A';
$bar = $cls::foo(); // assigns "bar" to $bar - syntax error on "::"
?>

Reproducible: Always
Comment 1 Andrew Crouthamel 2018-11-11 04:31:33 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 2 Jan Buchar 2018-11-11 11:19:04 UTC
I do not use KDevelop or PHP anymore, but the steps for reproduction seem simple enough for anyone to follow. Thanks for returning to this old issue!
Comment 3 Andrew Crouthamel 2018-11-12 03:08:52 UTC
Thanks for the update!
Comment 4 Heinz Wiesinger 2019-03-20 20:00:12 UTC
This no longer causes a syntax error for me on kdev-php 5.3