3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { static function foo($x = null) {} } $reflMethod = new ReflectionMethod('C', 'foo'); $reflParam = $reflMethod->getParameters()[0]; // Warning: Attempted to serialize unserializable builtin class ReflectionMethod $serReflMethod = serialize($reflMethod); // No warning. $serReflParam = serialize($reflParam); $unserReflParam = unserialize($serReflParam); // Fatal error: ReflectionParameter::isOptional(): Internal error: Failed to retrieve the reflection object $unserReflParam->isOptional();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvOFH
function name:  (null)
number of ops:  24
compiled vars:  !0 = $reflMethod, !1 = $reflParam, !2 = $serReflMethod, !3 = $serReflParam, !4 = $unserReflParam
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $5      'ReflectionMethod'
          1        SEND_VAL_EX                                              'C'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $5
    8     5        INIT_METHOD_CALL                                         !0, 'getParameters'
          6        DO_FCALL                                      0  $8      
          7        FETCH_DIM_R                                      ~9      $8, 0
          8        ASSIGN                                                   !1, ~9
   11     9        INIT_FCALL                                               'serialize'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $11     
         12        ASSIGN                                                   !2, $11
   14    13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !3, $13
   15    17        INIT_FCALL                                               'unserialize'
         18        SEND_VAR                                                 !3
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !4, $15
   18    21        INIT_METHOD_CALL                                         !4, 'isOptional'
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

Class C:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvOFH
function name:  foo
number of ops:  2
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
          1      > RETURN                                                   null

End of function foo

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
192.34 ms | 1395 KiB | 17 Q