3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fp = $fp = fopen(__FILE__, "r"); class classA { public function __toString() { return "Class A object"; } } $a = array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'); var_dump($a); var_dump(array_combine($a, $a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CdYaE
function name:  (null)
number of ops:  27
compiled vars:  !0 = $fp, !1 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'fopen'
          1        SEND_VAL                                                 '%2Fin%2FCdYaE'
          2        SEND_VAL                                                 'r'
          3        DO_ICALL                                         $2      
          4        ASSIGN                                           ~3      !0, $2
          5        ASSIGN                                                   !0, ~3
    3     6        DECLARE_CLASS                                            'classa'
    8     7        NEW                                              $5      'classA'
          8        DO_FCALL                                      0          
          9        INIT_ARRAY                                       ~7      11, $5
         10        BEGIN_SILENCE                                    ~8      
         11        FETCH_R                      local               ~9      'unset_var'
         12        END_SILENCE                                              ~8
         13        ADD_ARRAY_ELEMENT                                ~7      'hello', ~9
         14        ADD_ARRAY_ELEMENT                                ~7      'resource', !0
         15        ASSIGN                                                   !1, ~7
    9    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   10    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'array_combine'
         21        SEND_VAR                                                 !1
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Class classA:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CdYaE
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Class+A+object'
    6     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class classA.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.57 ms | 1396 KiB | 19 Q