Mobile app version of vmapp.org
Login or Join
Moriarity557

: 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;

@Moriarity557

Posted 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 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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Moriarity557

1 Comments

Sorted by latest first Latest Oldest Best

 

@Carla537

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;
?>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme