3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coalesce($default, &...$args) { return array_filter($args) ?: $default; } $e1 = []; $e2 = 'fur'; echo coalesce('default', $e1, $happy, $e2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qMrtW
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, 'fur'
   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/qMrtW
function name:  coalesce
number of ops:  9
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                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $2      
          5        JMP_SET                                          ~3      $2, ->7
          6        QM_ASSIGN                                        ~3      !0
          7      > RETURN                                                   ~3
    6     8*     > RETURN                                                   null

End of function coalesce

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.02 ms | 1397 KiB | 16 Q