3v4l.org

run code in 300+ PHP versions simultaneously
<?php function endswithy($value) { return (substr($value, -1) == 'y'); } $people = array("Johnny", "Timmy", "Bobby", "Sam", "Tammy", "Danny", "Joe"); $withy = array_filter($people, "endswithy"); var_dump($withy); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f9gJ4
function name:  (null)
number of ops:  10
compiled vars:  !0 = $people, !1 = $withy
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'endswithy'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    8     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    9     9      > RETURN                                                   1

Function endswithy:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f9gJ4
function name:  endswithy
number of ops:  8
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 -1
          4        DO_ICALL                                         $1      
          5        IS_EQUAL                                         ~2      $1, 'y'
          6      > RETURN                                                   ~2
    4     7*     > RETURN                                                   null

End of function endswithy

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.23 ms | 1395 KiB | 19 Q