3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php trait TraitWithProperties { private $a = 'foo'; protected $b = 'bar'; public $c = 'baz'; private static $as = self::class; protected static $bs = __TRAIT__; public static $cs = __CLASS__; } class SimpleClassWithTrait { use TraitWithProperties; } $refClass = new ReflectionClass('SimpleClassWithTrait'); var_dump($refClass->getStaticProperties());
based on aDdQ6
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/0n4mP
function name:  (null)
number of ops:  14
compiled vars:  !0 = $refClass
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  14     1        DECLARE_CLASS                                    $2      '%00simpleclasswithtrait%2Fin%2F0n4mP0x7fe71b481119', 'simpleclasswithtrait'
  16     2        ADD_TRAIT                                                $2, 'TraitWithProperties'
  14     3        BIND_TRAITS                                              $2
  19     4        NEW                                              $3      :-2
         5        SEND_VAL_EX                                              'SimpleClassWithTrait'
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !0, $3
  20     8        INIT_FCALL                                               'var_dump'
         9        INIT_METHOD_CALL                                         !0, 'getStaticProperties'
        10        DO_FCALL                                      0  $6      
        11        SEND_VAR                                                 $6
        12        DO_ICALL                                                 
        13      > RETURN                                                   1

Class TraitWithProperties: [no user functions]
Class SimpleClassWithTrait: [no user functions]

Generated using Vulcan Logic Dumper, using php 7.3.0