3v4l.org

run code in 300+ PHP versions simultaneously
<?php $needle ='apple'; $haystack = explode(', ', 'mango, peach, toothpaste, apes'); foreach ($haystack as &$v) { $v = [levenshtein($needle, $v), $v]; } sort($haystack); foreach ($haystack as [$lev, $h]) { echo "$needle/$h: $lev\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 7, Position 2 = 16
Branch analysis from position: 7
2 jumps found. (Code = 126) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 35
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 35
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 16
filename:       /in/dCipR
function name:  (null)
number of ops:  37
compiled vars:  !0 = $needle, !1 = $haystack, !2 = $v, !3 = $lev, !4 = $h
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'apple'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C+'
          3        SEND_VAL                                                 'mango%2C+peach%2C+toothpaste%2C+apes'
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    6     6      > FE_RESET_RW                                      $8      !1, ->16
          7    > > FE_FETCH_RW                                              $8, !2, ->16
    7     8    >   INIT_FCALL                                               'levenshtein'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        INIT_ARRAY                                       ~10     $9
         13        ADD_ARRAY_ELEMENT                                ~10     !2
         14        ASSIGN                                                   !2, ~10
    6    15      > JMP                                                      ->7
         16    >   FE_FREE                                                  $8
    9    17        INIT_FCALL                                               'sort'
         18        SEND_REF                                                 !1
         19        DO_ICALL                                                 
   11    20      > FE_RESET_R                                       $13     !1, ->35
         21    > > FE_FETCH_R                                               $13, $14, ->35
         22    >   FETCH_LIST_R                                     $15     $14, 0
         23        ASSIGN                                                   !3, $15
         24        FETCH_LIST_R                                     $17     $14, 1
         25        ASSIGN                                                   !4, $17
         26        FREE                                                     $14
   12    27        ROPE_INIT                                     6  ~20     !0
         28        ROPE_ADD                                      1  ~20     ~20, '%2F'
         29        ROPE_ADD                                      2  ~20     ~20, !4
         30        ROPE_ADD                                      3  ~20     ~20, '%3A+'
         31        ROPE_ADD                                      4  ~20     ~20, !3
         32        ROPE_END                                      5  ~19     ~20, '%0A'
         33        ECHO                                                     ~19
   11    34      > JMP                                                      ->21
         35    >   FE_FREE                                                  $13
   13    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.22 ms | 1017 KiB | 16 Q