3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $a = 0; } $obj = new ArrayObject(); $ref = (new ReflectionMethod('ArrayObject', '__construct'))->getClosure($obj); $test = new Test; $ref->bindTo($test, get_class($test))->__invoke(array('a' => 5, 'test'=>'value')); var_dump($test);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vALk3
function name:  (null)
number of ops:  26
compiled vars:  !0 = $obj, !1 = $ref, !2 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $3      'ArrayObject'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    9     3        NEW                                              $6      'ReflectionMethod'
          4        SEND_VAL_EX                                              'ArrayObject'
          5        SEND_VAL_EX                                              '__construct'
          6        DO_FCALL                                      0          
          7        INIT_METHOD_CALL                                         $6, 'getClosure'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $8      
         10        ASSIGN                                                   !1, $8
   11    11        NEW                                              $10     'Test'
         12        DO_FCALL                                      0          
         13        ASSIGN                                                   !2, $10
   12    14        INIT_METHOD_CALL                                         !1, 'bindTo'
         15        SEND_VAR_EX                                              !2
         16        GET_CLASS                                        ~13     !2
         17        SEND_VAL_EX                                              ~13
         18        DO_FCALL                                      0  $14     
         19        INIT_METHOD_CALL                                         $14, '__invoke'
         20        SEND_VAL_EX                                              <array>
         21        DO_FCALL                                      0          
   14    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Class Test: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.82 ms | 1395 KiB | 15 Q