3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $a = 'hello'; } interface Loggable { public function log(Foo $queueName = null); } class QMSLogger implements Loggable { public function log(Foo $queueName = null) { echo $queueName !== null ? $queueName->a : "Foo"; } } $foo = new QMSLogger(); $foo->log(Foo());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qihFm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'qmslogger'
   21     1        NEW                                              $1      'QMSLogger'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'log'
          5        INIT_FCALL_BY_NAME                                       'Foo'
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR_NO_REF_EX                                       $4
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class Foo: [no user functions]
Class Loggable:
Function log:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qihFm
function name:  log
number of ops:  2
compiled vars:  !0 = $queueName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                        !0      null
          1      > RETURN                                                   null

End of function log

End of class Loggable.

Class QMSLogger:
Function log:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qihFm
function name:  log
number of ops:  9
compiled vars:  !0 = $queueName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      null
   17     1        TYPE_CHECK                                  1020          !0
          2      > JMPZ                                                     ~1, ->6
          3    >   FETCH_OBJ_R                                      ~2      !0, 'a'
          4        QM_ASSIGN                                        ~3      ~2
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~3      'Foo'
          7    >   ECHO                                                     ~3
   18     8      > RETURN                                                   null

End of function log

End of class QMSLogger.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.58 ms | 1399 KiB | 14 Q