3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = new class { public $a; public $b = null; public $c = ""; public function write($name) { return $a[$name] = $name; } }; var_dump($test->write([1,2,3])); var_dump($test->write("test")); var_dump($test->write(123456));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vMRt3
function name:  (null)
number of ops:  23
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_ANON_CLASS                               <unknown> 
          1        NEW                                              $2      $1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   13     4        INIT_FCALL                                               'var_dump'
          5        INIT_METHOD_CALL                                         !0, 'write'
          6        SEND_VAL_EX                                              <array>
          7        DO_FCALL                                      0  $5      
          8        SEND_VAR                                                 $5
          9        DO_ICALL                                                 
   14    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !0, 'write'
         12        SEND_VAL_EX                                              'test'
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR                                                 $7
         15        DO_ICALL                                                 
   15    16        INIT_FCALL                                               'var_dump'
         17        INIT_METHOD_CALL                                         !0, 'write'
         18        SEND_VAL_EX                                              123456
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR                                                 $9
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Class class@anonymous:
Function write:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vMRt3
function name:  write
number of ops:  5
compiled vars:  !0 = $name, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN_DIM                                       ~2      !1, !0
          2        OP_DATA                                                  !0
          3      > RETURN                                                   ~2
   10     4*     > RETURN                                                   null

End of function write

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.8 ms | 1396 KiB | 15 Q