3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __toString() { return "foo"; } } function stripos2(string $haystack, string $needle) { return stripos($haystack, $needle); } var_dump(stripos2("foobar", new Foo()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vthrq
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   13     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'stripos2'
          3        SEND_VAL                                                 'foobar'
          4        NEW                                              $0      'Foo'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $0
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function stripos2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vthrq
function name:  stripos2
number of ops:  8
compiled vars:  !0 = $haystack, !1 = $needle
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'stripos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
   11     7*     > RETURN                                                   null

End of function stripos2

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

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.35 ms | 1398 KiB | 18 Q