3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new \stdClass(); $a->rec = $a; print_r($a); var_dump($a); $a = new class() { public function __toString(): string { static $c = 0; if ($c++ > 1) { throw new \Exception('ex'); } return '1'; } }; echo $a, $a, $a;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DWqcW
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
    4     3        ASSIGN_OBJ                                               !0, 'rec'
          4        OP_DATA                                                  !0
    6     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
    9    11        DECLARE_ANON_CLASS                               <unknown> 
         12        NEW                                              $8      $7
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !0, $8
   20    15        ECHO                                                     !0
         16        ECHO                                                     !0
         17        ECHO                                                     !0
   21    18      > RETURN                                                   1

Class class@anonymous:
Function __tostring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DWqcW
function name:  __toString
number of ops:  11
compiled vars:  !0 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   BIND_STATIC                                              !0
   12     1        POST_INC                                         ~1      !0
          2        IS_SMALLER                                               1, ~1
          3      > JMPZ                                                     ~2, ->8
   13     4    >   NEW                                              $3      'Exception'
          5        SEND_VAL_EX                                              'ex'
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $3
   16     8    > > RETURN                                                   '1'
   17     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function __tostring

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.52 ms | 1004 KiB | 15 Q