3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * PHP 5.6 Variadics allow us to pack arguments into arrays from the function prototype! * Typically you would use a combination of func_get_args and array_slice to grab these * function arguments from the stack frame, but Variadics make the syntax much nicer. */ function bond($agent) { $bondingAgents = array_slice(func_get_args(), 1); $bonding = ""; foreach ($bondingAgents as $bond) { $bonding .= "$agent-$bond\n"; } return $bonding; } header('Content-type: text/plain'); echo bond("Hydrogen", "Oxide", "Peroxide", "Dioxide");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tPQVf
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+text%2Fplain'
          2        DO_ICALL                                                 
   18     3        INIT_FCALL                                               'bond'
          4        SEND_VAL                                                 'Hydrogen'
          5        SEND_VAL                                                 'Oxide'
          6        SEND_VAL                                                 'Peroxide'
          7        SEND_VAL                                                 'Dioxide'
          8        DO_FCALL                                      0  $1      
          9        ECHO                                                     $1
         10      > RETURN                                                   1

Function bond:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 12
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 12
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/tPQVf
function name:  bond
number of ops:  15
compiled vars:  !0 = $agent, !1 = $bondingAgents, !2 = $bonding, !3 = $bond
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        FUNC_GET_ARGS                                    ~4      1
          2        ASSIGN                                                   !1, ~4
    9     3        ASSIGN                                                   !2, ''
   10     4      > FE_RESET_R                                       $7      !1, ->12
          5    > > FE_FETCH_R                                               $7, !3, ->12
   11     6    >   ROPE_INIT                                     4  ~9      !0
          7        ROPE_ADD                                      1  ~9      ~9, '-'
          8        ROPE_ADD                                      2  ~9      ~9, !3
          9        ROPE_END                                      3  ~8      ~9, '%0A'
         10        ASSIGN_OP                                     8          !2, ~8
   10    11      > JMP                                                      ->5
         12    >   FE_FREE                                                  $7
   13    13      > RETURN                                                   !2
   14    14*     > RETURN                                                   null

End of function bond

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.28 ms | 1390 KiB | 16 Q