3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coalesce($default, &...$args) { return current(array_filter($args)) ?: $default; } $e1 = []; $e2 = ''; echo coalesce('default', $e1, $happy, $e2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DVnSo
function name:  (null)
number of ops:  10
compiled vars:  !0 = $e1, !1 = $e2, !2 = $happy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, ''
   10     2        INIT_FCALL                                               'coalesce'
          3        SEND_VAL                                                 'default'
          4        SEND_REF                                                 !0
          5        SEND_REF                                                 !2
          6        SEND_REF                                                 !1
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Function coalesce:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DVnSo
function name:  coalesce
number of ops:  12
compiled vars:  !0 = $default, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    5     2        INIT_FCALL                                               'current'
          3        INIT_FCALL                                               'array_filter'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                         $3      
          8        JMP_SET                                          ~4      $3, ->10
          9        QM_ASSIGN                                        ~4      !0
         10      > RETURN                                                   ~4
    6    11*     > RETURN                                                   null

End of function coalesce

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.11 ms | 1398 KiB | 18 Q