3v4l.org

run code in 300+ PHP versions simultaneously
<?php $closure = (new ReflectionFunction('strlen'))->getClosure()->bindTo(new DateTime(), 'DateTime'); var_dump($closure('foo'), (new ReflectionFunction($closure))->getName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LQlGv
function name:  (null)
number of ops:  25
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'ReflectionFunction'
          1        SEND_VAL_EX                                              'strlen'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $1, 'getClosure'
          4        DO_FCALL                                      0  $3      
          5        INIT_METHOD_CALL                                         $3, 'bindTo'
          6        NEW                                              $4      'DateTime'
          7        DO_FCALL                                      0          
          8        SEND_VAR_NO_REF_EX                                       $4
          9        SEND_VAL_EX                                              'DateTime'
         10        DO_FCALL                                      0  $6      
         11        ASSIGN                                                   !0, $6
    4    12        INIT_FCALL                                               'var_dump'
         13        INIT_DYNAMIC_CALL                                        !0
         14        SEND_VAL_EX                                              'foo'
         15        DO_FCALL                                      0  $8      
         16        SEND_VAR                                                 $8
         17        NEW                                              $9      'ReflectionFunction'
         18        SEND_VAR_EX                                              !0
         19        DO_FCALL                                      0          
         20        INIT_METHOD_CALL                                         $9, 'getName'
         21        DO_FCALL                                      0  $11     
         22        SEND_VAR                                                 $11
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.35 ms | 1395 KiB | 15 Q