3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ScoreWords($Value){ $WordList = array( "Amazing" => 1, "Value" => 300, "Elements" => 30, "Another" => 0 ); if (array_key_exists($Value,$WordList)){ return $WordList[$Value]; } } $array = ["Value","Another",1,2,3,4]; echo implode(',', $array), PHP_EOL; foreach ($array as &$value) { ScoreWords($value); } echo implode(',', $array), PHP_EOL; foreach ($array as $value) { ScoreWords($value); } echo implode(',', $array), PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 26
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 13
filename:       /in/rSaZq
function name:  (null)
number of ops:  34
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, <array>
   18     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ECHO                                                     $3
          6        ECHO                                                     '%0A'
   20     7      > FE_RESET_RW                                      $4      !0, ->13
          8    > > FE_FETCH_RW                                              $4, !1, ->13
   21     9    >   INIT_FCALL                                               'scorewords'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0          
   20    12      > JMP                                                      ->8
         13    >   FE_FREE                                                  $4
   23    14        INIT_FCALL                                               'implode'
         15        SEND_VAL                                                 '%2C'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $6      
         18        ECHO                                                     $6
         19        ECHO                                                     '%0A'
   25    20      > FE_RESET_R                                       $7      !0, ->26
         21    > > FE_FETCH_R                                               $7, !1, ->26
   26    22    >   INIT_FCALL                                               'scorewords'
         23        SEND_VAR                                                 !1
         24        DO_FCALL                                      0          
   25    25      > JMP                                                      ->21
         26    >   FE_FREE                                                  $7
   28    27        INIT_FCALL                                               'implode'
         28        SEND_VAL                                                 '%2C'
         29        SEND_VAR                                                 !0
         30        DO_ICALL                                         $9      
         31        ECHO                                                     $9
         32        ECHO                                                     '%0A'
         33      > RETURN                                                   1

Function scorewords:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSaZq
function name:  ScoreWords
number of ops:  7
compiled vars:  !0 = $Value, !1 = $WordList
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
   11     2        ARRAY_KEY_EXISTS                                         !0, !1
          3      > JMPZ                                                     ~3, ->6
   12     4    >   FETCH_DIM_R                                      ~4      !1, !0
          5      > RETURN                                                   ~4
   15     6    > > RETURN                                                   null

End of function scorewords

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.33 ms | 1403 KiB | 17 Q