3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function __toString() { return $this->to_string(); } public function to_string() { $s = (string)$this; return $s; } } $t = new Test; $t->to_string();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZhSKg
function name:  (null)
number of ops:  7
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
   17     1        NEW                                              $1      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   18     4        INIT_METHOD_CALL                                         !0, 'to_string'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Test:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZhSKg
function name:  __toString
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_METHOD_CALL                                         'to_string'
          1        DO_FCALL                                      0  $0      
          2        VERIFY_RETURN_TYPE                                       $0
          3      > RETURN                                                   $0
    8     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function __tostring

Function to_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZhSKg
function name:  to_string
number of ops:  5
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_THIS                                       ~1      
          1        CAST                                          6  ~2      ~1
          2        ASSIGN                                                   !0, ~2
   13     3      > RETURN                                                   !0
   14     4*     > RETURN                                                   null

End of function to_string

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.35 ms | 1394 KiB | 13 Q