3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coalesce(&...$args) { foreach ($args as &$arg) { if (!empty($arg)) { return $arg; } } return $default; } echo coalesce($happy, false, 'boring', 'default');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JAhcY
function name:  (null)
number of ops:  8
compiled vars:  !0 = $happy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'coalesce'
          1        SEND_REF                                                 !0
          2        SEND_VAL_EX                                              <false>
          3        SEND_VAL_EX                                              'boring'
          4        SEND_VAL_EX                                              'default'
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
          7      > RETURN                                                   1

Function coalesce:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/JAhcY
function name:  coalesce
number of ops:  12
compiled vars:  !0 = $args, !1 = $arg, !2 = $default
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV_VARIADIC                                    !0      
    5     1      > FE_RESET_RW                                      $3      !0, ->9
          2    > > FE_FETCH_RW                                              $3, !1, ->9
    6     3    >   ISSET_ISEMPTY_CV                                 ~4      !1
          4        BOOL_NOT                                         ~5      ~4
          5      > JMPZ                                                     ~5, ->8
    7     6    >   FE_FREE                                                  $3
          7      > RETURN                                                   !1
    5     8    > > JMP                                                      ->2
          9    >   FE_FREE                                                  $3
   11    10      > RETURN                                                   !2
   12    11*     > RETURN                                                   null

End of function coalesce

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.85 ms | 1398 KiB | 14 Q