3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __construct( public ?array $meta = null, ) {} } class Bar { public ?array $meta = null; public function __construct(?array $meta = null) { $this->meta = $meta; } } $foo = new ReflectionClass(new Foo); $bar = new ReflectionClass(new Bar); var_dump($foo->getProperty('meta')->hasDefaultValue()); var_dump($bar->getProperty('meta')->hasDefaultValue());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Bndi
function name:  (null)
number of ops:  29
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $2      'ReflectionClass'
          1        NEW                                              $3      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   21     6        NEW                                              $7      'ReflectionClass'
          7        NEW                                              $8      'Bar'
          8        DO_FCALL                                      0          
          9        SEND_VAR_NO_REF_EX                                       $8
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   22    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !0, 'getProperty'
         14        SEND_VAL_EX                                              'meta'
         15        DO_FCALL                                      0  $12     
         16        INIT_METHOD_CALL                                         $12, 'hasDefaultValue'
         17        DO_FCALL                                      0  $13     
         18        SEND_VAR                                                 $13
         19        DO_ICALL                                                 
   23    20        INIT_FCALL                                               'var_dump'
         21        INIT_METHOD_CALL                                         !1, 'getProperty'
         22        SEND_VAL_EX                                              'meta'
         23        DO_FCALL                                      0  $15     
         24        INIT_METHOD_CALL                                         $15, 'hasDefaultValue'
         25        DO_FCALL                                      0  $16     
         26        SEND_VAR                                                 $16
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Bndi
function name:  __construct
number of ops:  4
compiled vars:  !0 = $meta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
          1        ASSIGN_OBJ                                               'meta'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

End of class Foo.

Class Bar:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Bndi
function name:  __construct
number of ops:  4
compiled vars:  !0 = $meta
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV_INIT                                        !0      null
   16     1        ASSIGN_OBJ                                               'meta'
          2        OP_DATA                                                  !0
   17     3      > RETURN                                                   null

End of function __construct

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.41 ms | 1074 KiB | 14 Q