3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($test) { return $test ? : 'default'; } echo test(null) . PHP_EOL; echo test('hello') . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bffBu
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'test'
          1        SEND_VAL                                                 null
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%0A'
          4        ECHO                                                     ~1
    8     5        INIT_FCALL                                               'test'
          6        SEND_VAL                                                 'hello'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      $2, '%0A'
          9        ECHO                                                     ~3
         10      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bffBu
function name:  test
number of ops:  5
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        JMP_SET                                          ~1      !0, ->3
          2        QM_ASSIGN                                        ~1      'default'
          3      > RETURN                                                   ~1
    5     4*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
207.86 ms | 1397 KiB | 15 Q