3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test( self $arg = null ){ echo get_class( $arg ) . "\n"; echo is_null( $arg ); } } $foo = new Foo(); $bar = new Foo(); $foo->test( $bar ); $foo->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TP5AV
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo, !1 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   11     3        NEW                                              $5      'Foo'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   13     6        INIT_METHOD_CALL                                         !0, 'test'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
   14     9        INIT_METHOD_CALL                                         !0, 'test'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TP5AV
function name:  test
number of ops:  7
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_INIT                                        !0      null
    5     1        GET_CLASS                                        ~1      !0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    6     4        TYPE_CHECK                                    2  ~3      !0
          5        ECHO                                                     ~3
    7     6      > RETURN                                                   null

End of function test

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.08 ms | 1385 KiB | 13 Q