3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); class Foo { function __toString() {} } function myadd(int $a, int $b): Foo { return new Foo; return $a + $b . "hello"; } echo myadd(6, 7);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sjmQq
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'foo'
   13     1        INIT_FCALL                                               'myadd'
          2        SEND_VAL                                                 6
          3        SEND_VAL                                                 7
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
          6      > RETURN                                                   1

Function myadd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sjmQq
function name:  myadd
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        NEW                                              $2      'Foo'
          3        DO_FCALL                                      0          
          4        VERIFY_RETURN_TYPE                                       $2
          5      > RETURN                                                   $2
   10     6*       ADD                                              ~4      !0, !1
          7*       CONCAT                                           ~5      ~4, 'hello'
          8*       VERIFY_RETURN_TYPE                                       ~5
          9*       RETURN                                                   ~5
   11    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function myadd

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

End of function __tostring

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.03 ms | 1398 KiB | 14 Q