3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $a = 5; public function __toString () { var_dump("to string"); return "A"; } } $a = new A(); echo $a; b("test" . $a); function b ($t) { echo $t; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JYS6
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
   13     1        NEW                                              $1      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   14     4        ECHO                                                     !0
   15     5        INIT_FCALL_BY_NAME                                       'b'
          6        CONCAT                                           ~4      'test', !0
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0          
   20     9      > RETURN                                                   1

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4JYS6
function name:  b
number of ops:  3
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        ECHO                                                     !0
   20     2      > RETURN                                                   null

End of function b

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

End of function __tostring

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.83 ms | 1395 KiB | 15 Q