3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ( [ 'array' => ['foo'], 'string' => 'foo', 'int' => 3, 'class' => new stdClass(), 'good input' => 'foo@bar.com' ] as $inputName => $input) { foreach ( [ 'validate' => FILTER_VALIDATE_EMAIL, 'sanitize' => FILTER_SANITIZE_EMAIL, ] as $filerName => $filter ) { foreach( [ 'none' => [], 'default of int 5' => ['options' => ['default' => 5]], 'default with null failure' => ['flags' => FILTER_NULL_ON_FAILURE, 'options' => ['default' => 5]], 'null failure' => ['flags' => FILTER_NULL_ON_FAILURE], 'default with null failue and force array' => ['flags' => FILTER_NULL_ON_FAILURE | FILTER_FORCE_ARRAY, 'options' => ['default' => 5]], 'default with force array' => ['flags' => FILTER_FORCE_ARRAY, 'options' => ['default' => 5]], 'force array' => ['flags' => FILTER_FORCE_ARRAY], ] as $optionsName => $options) { echo "$inputName\t$filerName\t$optionsName\n"; var_dump(filter_var($input, $filter, $options)); } } }

Abusive script

This script was stopped while abusing our resources

Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 36
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 36
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 34
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 34
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 32
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 32
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 32
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 34
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/NbAhc
function name:  (null)
number of ops:  38
compiled vars:  !0 = $input, !1 = $inputName, !2 = $filter, !3 = $filerName, !4 = $options, !5 = $optionsName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_ARRAY                                       ~6      <array>, 'array'
    6     1        ADD_ARRAY_ELEMENT                                ~6      'foo', 'string'
    7     2        ADD_ARRAY_ELEMENT                                ~6      3, 'int'
    8     3        NEW                                              $7      'stdClass'
          4        DO_FCALL                                      0          
          5        ADD_ARRAY_ELEMENT                                ~6      $7, 'class'
    9     6        ADD_ARRAY_ELEMENT                                ~6      'foo%40bar.com', 'good+input'
          7      > FE_RESET_R                                       $9      ~6, ->36
          8    > > FE_FETCH_R                                       ~10     $9, !0, ->36
   10     9    >   ASSIGN                                                   !1, ~10
   13    10      > FE_RESET_R                                       $12     <array>, ->34
         11    > > FE_FETCH_R                                       ~13     $12, !2, ->34
   15    12    >   ASSIGN                                                   !3, ~13
   18    13      > FE_RESET_R                                       $15     <array>, ->32
         14    > > FE_FETCH_R                                       ~16     $15, !4, ->32
   27    15    >   ASSIGN                                                   !5, ~16
   28    16        ROPE_INIT                                     6  ~19     !1
         17        ROPE_ADD                                      1  ~19     ~19, '%09'
         18        ROPE_ADD                                      2  ~19     ~19, !3
         19        ROPE_ADD                                      3  ~19     ~19, '%09'
         20        ROPE_ADD                                      4  ~19     ~19, !5
         21        ROPE_END                                      5  ~18     ~19, '%0A'
         22        ECHO                                                     ~18
   29    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'filter_var'
         25        SEND_VAR                                                 !0
         26        SEND_VAR                                                 !2
         27        SEND_VAR                                                 !4
         28        DO_ICALL                                         $22     
         29        SEND_VAR                                                 $22
         30        DO_ICALL                                                 
   18    31      > JMP                                                      ->14
         32    >   FE_FREE                                                  $15
   13    33      > JMP                                                      ->11
         34    >   FE_FREE                                                  $12
    5    35      > JMP                                                      ->8
         36    >   FE_FREE                                                  $9
   32    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.1 ms | 1008 KiB | 15 Q