: What's the double semicolon (::) for in PHP? I'm working with NetSuite's PHP toolkit and i get the error T_PAAMAYIM_NEKUDOTAYIM from this line $classname = get_class($object); $typesmap = $classname::$paramtypesmap;
I'm working with NetSuite's PHP toolkit and i get the error T_PAAMAYIM_NEKUDOTAYIM from this line
$classname = get_class($object);
$typesmap = $classname::$paramtypesmap; <---
I just want to know what's the '::' for, since is from there that i've seen the error is coming from.
All my dev work is on hold for this error and it has been almost a week.
My guess, it takes the value from $paramtypesmap to $typesmap depending the class name, which may seem kind of obvious, but the point is that i've never seen the '::' been used before.
More posts by @Moriarity557
1 Comments
Sorted by latest first Latest Oldest Best
It's the scope resolution operator:
www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php
Example
<?php
class AClass {
const THE_CONST_VALUE = 'The const value';
}
$classname = 'AClass';
echo $classname::THE_CONST_VALUE; // As of PHP 5.3.0
echo AClass::THE_CONST_VALUE;
?>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.