3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr =[ "id" => "integer:>0", "interval_id" => "string:!empty", "miles" => "integer:optional", "kms" => "integer:optional", "created_by" => "string:!empty|null", "created_at" => "integer:>0|null", "updated_by" => "string:!empty|null", "updated_at" => "integer:>0|null" ]; foreach ($arr as $key => $value) { // echo $key, "==>", $value, "\n"; if ( substr_count($value, 'optional')){ echo $key, "\n"; } }
based on WbJ3X
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
Jump found. Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
Jump found. Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
Jump found. Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
Branch analysis from position: 12
Jump found. Position 1 = -2
Branch analysis from position: 12
filename:       /in/gMIIU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $arr, !1 = $value, !2 = $key
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, <array>
  13     1      > FE_RESET_R                                       $4      !0, ->12
         2    > > FE_FETCH_R                                       ~5      $4, !1, ->12
         3    >   ASSIGN                                                   !2, ~5
  15     4        INIT_FCALL                                               'substr_count'
         5        SEND_VAR                                                 !1
         6        SEND_VAL                                                 'optional'
         7        DO_ICALL                                         $7      
         8      > JMPZ                                                     $7, ->11
  16     9    >   ECHO                                                     !2
        10        ECHO                                                     '%0A'
        11    > > JMP                                                      ->2
        12    >   FE_FREE                                                  $4
        13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0