3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($str) { // tvCoerceParamToStringInPlace return fb_htmlspecialchars($str, ENT_FB_UTF8, 'UTF-8', null); } class Foo { // will throw an exception function __toString() { return 2; } } var_dump(x(new Foo));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nv1NL
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   DECLARE_CLASS                                            'foo'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'x'
          3        NEW                                              $0      'Foo'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nv1NL
function name:  x
number of ops:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        INIT_FCALL_BY_NAME                                       'fb_htmlspecialchars'
          2        SEND_VAR_EX                                              !0
          3        FETCH_CONSTANT                                   ~1      'ENT_FB_UTF8'
          4        SEND_VAL_EX                                              ~1
          5        SEND_VAL_EX                                              'UTF-8'
          6        SEND_VAL_EX                                              null
          7        DO_FCALL                                      0  $2      
          8      > RETURN                                                   $2
    6     9*     > RETURN                                                   null

End of function x

Class Foo:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nv1NL
function name:  __toString
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   VERIFY_RETURN_TYPE                               ~0      2
          1      > RETURN                                                   ~0
   12     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.11 ms | 1399 KiB | 16 Q