3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class EmptySetter { public $foo = NULL; public function __set($name, $value) {} } class NonEmptySetter { public function __set($name, $value) { $this->{$name} = $value; } } function benchmark($class_name) { $start_time = microtime(TRUE); for ($i = 0; $i < 1000000; $i++) { $obj = new $class_name(); $obj->foo = 42; } return microtime(TRUE) - $start_time; } printf("NonEmptySetter: %.2f seconds\n", benchmark('NonEmptySetter')); printf("EmptySetter: %.2f seconds\n", benchmark('EmptySetter'));
Output for 7.0.0, 7.1.7
NonEmptySetter: 0.30 seconds EmptySetter: 0.11 seconds
Output for 7.1.6
NonEmptySetter: 0.26 seconds EmptySetter: 0.14 seconds
Output for 7.0.5, 7.1.5
NonEmptySetter: 0.32 seconds EmptySetter: 0.11 seconds
Output for 7.1.0
NonEmptySetter: 0.01 seconds EmptySetter: -0.10 seconds
Output for 7.0.20
NonEmptySetter: 0.36 seconds EmptySetter: 0.11 seconds
Output for 7.0.14
NonEmptySetter: 0.33 seconds EmptySetter: 0.14 seconds
Output for 7.0.6
NonEmptySetter: 0.32 seconds EmptySetter: 0.12 seconds
Output for 7.0.4
NonEmptySetter: 0.28 seconds EmptySetter: 0.11 seconds
Output for 7.0.3
NonEmptySetter: 0.29 seconds EmptySetter: 0.11 seconds
Output for 7.0.2
NonEmptySetter: 0.33 seconds EmptySetter: 0.11 seconds
Output for 7.0.1
NonEmptySetter: 0.36 seconds EmptySetter: 0.13 seconds
Output for 5.6.28
NonEmptySetter: 0.52 seconds EmptySetter: 0.18 seconds
Output for 5.6.21
NonEmptySetter: 0.57 seconds EmptySetter: 0.17 seconds
Output for 5.6.20
NonEmptySetter: 0.58 seconds EmptySetter: 0.18 seconds
Output for 5.6.19
NonEmptySetter: 0.50 seconds EmptySetter: 0.17 seconds
Output for 5.6.18
NonEmptySetter: 0.49 seconds EmptySetter: 0.17 seconds
Output for 5.5.27, 5.5.32, 5.6.13, 5.6.17
NonEmptySetter: 0.55 seconds EmptySetter: 0.18 seconds
Output for 5.5.30, 5.6.8, 5.6.16
NonEmptySetter: 0.56 seconds EmptySetter: 0.18 seconds
Output for 5.6.15
NonEmptySetter: 0.56 seconds EmptySetter: 0.17 seconds
Output for 5.6.14
NonEmptySetter: 0.61 seconds EmptySetter: 0.19 seconds
Output for 5.5.28, 5.5.34, 5.6.12
NonEmptySetter: 0.57 seconds EmptySetter: 0.18 seconds
Output for 5.6.11
NonEmptySetter: 0.54 seconds EmptySetter: 0.17 seconds
Output for 5.6.10
NonEmptySetter: 0.55 seconds EmptySetter: 0.17 seconds
Output for 5.6.9
NonEmptySetter: 0.61 seconds EmptySetter: 0.18 seconds
Output for 5.6.7
NonEmptySetter: 0.51 seconds EmptySetter: 0.14 seconds
Output for 5.5.35
NonEmptySetter: 0.59 seconds EmptySetter: 0.19 seconds
Output for 5.5.33
NonEmptySetter: 0.51 seconds EmptySetter: 0.19 seconds
Output for 5.5.31
NonEmptySetter: 0.58 seconds EmptySetter: 0.19 seconds
Output for 5.5.25, 5.5.29
NonEmptySetter: 0.56 seconds EmptySetter: 0.19 seconds
Output for 5.5.24, 5.5.26
NonEmptySetter: 0.53 seconds EmptySetter: 0.18 seconds
Output for 5.4.45
NonEmptySetter: 0.75 seconds EmptySetter: 0.27 seconds
Output for 5.4.44
NonEmptySetter: 0.75 seconds EmptySetter: 0.26 seconds
Output for 5.4.43
NonEmptySetter: 1.10 seconds EmptySetter: 0.28 seconds
Output for 5.4.42
NonEmptySetter: 0.71 seconds EmptySetter: 0.26 seconds
Output for 5.4.41
NonEmptySetter: 0.72 seconds EmptySetter: 0.26 seconds
Output for 5.4.40
NonEmptySetter: 0.73 seconds EmptySetter: 0.26 seconds
Output for 5.4.39
NonEmptySetter: 0.77 seconds EmptySetter: 0.27 seconds
Output for 5.4.38
NonEmptySetter: 0.75 seconds EmptySetter: 0.25 seconds
Output for 5.4.34, 5.4.37
NonEmptySetter: 0.75 seconds EmptySetter: 0.29 seconds
Output for 5.4.36
NonEmptySetter: 0.80 seconds EmptySetter: 0.31 seconds
Output for 5.4.35
NonEmptySetter: 0.73 seconds EmptySetter: 0.27 seconds
Output for 5.4.32
NonEmptySetter: 0.58 seconds EmptySetter: 0.20 seconds
Output for 5.4.31
NonEmptySetter: 0.60 seconds EmptySetter: 0.21 seconds
Output for 5.4.30
NonEmptySetter: 0.69 seconds EmptySetter: 0.21 seconds
Output for 5.4.29
NonEmptySetter: 0.81 seconds EmptySetter: 0.36 seconds
Output for 5.4.28
NonEmptySetter: 0.66 seconds EmptySetter: 0.21 seconds
Output for 5.4.27
NonEmptySetter: 0.93 seconds EmptySetter: 0.29 seconds
Output for 5.4.26
NonEmptySetter: 1.01 seconds EmptySetter: 0.32 seconds
Output for 5.4.25
NonEmptySetter: 0.94 seconds EmptySetter: 0.34 seconds
Output for 5.4.24
NonEmptySetter: 0.94 seconds EmptySetter: 0.33 seconds
Output for 5.4.23
NonEmptySetter: 0.87 seconds EmptySetter: 0.37 seconds
Output for 5.4.22
NonEmptySetter: 0.92 seconds EmptySetter: 0.32 seconds
Output for 5.4.21
NonEmptySetter: 1.18 seconds EmptySetter: 0.30 seconds
Output for 5.4.20
NonEmptySetter: 0.95 seconds EmptySetter: 0.26 seconds
Output for 5.4.19
NonEmptySetter: 0.98 seconds EmptySetter: 0.51 seconds
Output for 5.4.18
NonEmptySetter: 0.89 seconds EmptySetter: 0.49 seconds
Output for 5.4.17
NonEmptySetter: 0.83 seconds EmptySetter: 0.29 seconds
Output for 5.4.16
NonEmptySetter: 1.34 seconds EmptySetter: 0.47 seconds
Output for 5.4.15
NonEmptySetter: 1.03 seconds EmptySetter: 0.29 seconds
Output for 5.4.14
NonEmptySetter: 1.09 seconds EmptySetter: 0.38 seconds
Output for 5.4.13
NonEmptySetter: 1.00 seconds EmptySetter: 0.35 seconds
Output for 5.4.12
NonEmptySetter: 1.43 seconds EmptySetter: 0.34 seconds
Output for 5.4.11
NonEmptySetter: 0.84 seconds EmptySetter: 0.28 seconds
Output for 5.4.10
NonEmptySetter: 1.10 seconds EmptySetter: 0.42 seconds
Output for 5.4.9
NonEmptySetter: 0.89 seconds EmptySetter: 0.35 seconds
Output for 5.4.8
NonEmptySetter: 0.85 seconds EmptySetter: 0.28 seconds
Output for 5.4.7
NonEmptySetter: 1.04 seconds EmptySetter: 0.29 seconds
Output for 5.4.6
NonEmptySetter: 1.35 seconds EmptySetter: 0.31 seconds
Output for 5.4.5
NonEmptySetter: 1.03 seconds EmptySetter: 0.49 seconds
Output for 5.4.4
NonEmptySetter: 0.83 seconds EmptySetter: 0.34 seconds
Output for 5.4.3
NonEmptySetter: 0.86 seconds EmptySetter: 0.30 seconds
Output for 5.4.2
NonEmptySetter: 1.11 seconds EmptySetter: 0.47 seconds
Output for 5.4.1
NonEmptySetter: 1.23 seconds EmptySetter: 0.39 seconds
Output for 5.4.0
NonEmptySetter: 1.23 seconds EmptySetter: 0.53 seconds
Output for 5.3.29
NonEmptySetter: 0.69 seconds EmptySetter: 0.31 seconds
Output for 5.3.28
NonEmptySetter: 1.07 seconds EmptySetter: 0.38 seconds
Output for 5.3.27
NonEmptySetter: 1.02 seconds EmptySetter: 0.54 seconds
Output for 5.3.26
NonEmptySetter: 1.10 seconds EmptySetter: 0.41 seconds
Output for 5.3.25
NonEmptySetter: 1.07 seconds EmptySetter: 0.41 seconds
Output for 5.3.24
NonEmptySetter: 1.02 seconds EmptySetter: 0.51 seconds
Output for 5.3.23
NonEmptySetter: 0.97 seconds EmptySetter: 0.43 seconds
Output for 5.3.22
NonEmptySetter: 1.00 seconds EmptySetter: 0.52 seconds
Output for 5.3.21
NonEmptySetter: 1.05 seconds EmptySetter: 0.50 seconds
Output for 5.3.20
NonEmptySetter: 0.98 seconds EmptySetter: 0.50 seconds
Output for 5.3.19
NonEmptySetter: 0.97 seconds EmptySetter: 0.46 seconds
Output for 5.3.18
NonEmptySetter: 1.14 seconds EmptySetter: 0.75 seconds
Output for 5.3.17
NonEmptySetter: 1.28 seconds EmptySetter: 0.53 seconds
Output for 5.3.16
NonEmptySetter: 1.17 seconds EmptySetter: 0.51 seconds
Output for 5.3.15
NonEmptySetter: 1.31 seconds EmptySetter: 0.44 seconds
Output for 5.3.14
NonEmptySetter: 0.89 seconds EmptySetter: 0.44 seconds
Output for 5.3.13
NonEmptySetter: 1.19 seconds EmptySetter: 0.48 seconds
Output for 5.3.12
NonEmptySetter: 1.06 seconds EmptySetter: 0.43 seconds
Output for 5.3.11
NonEmptySetter: 1.36 seconds EmptySetter: 0.52 seconds
Output for 5.3.10
NonEmptySetter: 1.27 seconds EmptySetter: 0.45 seconds
Output for 5.3.9
NonEmptySetter: 0.91 seconds EmptySetter: 0.41 seconds
Output for 5.3.8
NonEmptySetter: 1.22 seconds EmptySetter: 0.68 seconds
Output for 5.3.7
NonEmptySetter: 0.98 seconds EmptySetter: 0.80 seconds
Output for 5.3.6
NonEmptySetter: 1.73 seconds EmptySetter: 0.52 seconds
Output for 5.3.5
Could not open input file: /in/B3TE3
Process exited with code 1.
Output for 5.2.9, 5.3.4
NonEmptySetter: 1.83 seconds
Process exited with code 137.
Output for 5.3.3
NonEmptySetter: 1.30 seconds EmptySetter: 0.64 seconds
Output for 5.3.2
NonEmptySetter: 1.30 seconds EmptySetter: 0.44 seconds
Output for 5.3.1
NonEmptySetter: 1.38 seconds EmptySetter: 0.78 seconds
Output for 5.3.0
NonEmptySetter: 1.47 seconds EmptySetter: 0.54 seconds
Output for 5.2.17
NonEmptySetter: 2.35 seconds
Process exited with code 137.
Output for 5.2.16
NonEmptySetter: 1.36 seconds EmptySetter: 0.88 seconds
Output for 5.2.15
NonEmptySetter: 1.78 seconds
Process exited with code 137.
Output for 5.2.14
NonEmptySetter: 1.92 seconds
Process exited with code 137.
Output for 5.2.13
NonEmptySetter: 1.49 seconds EmptySetter: 0.53 seconds
Output for 5.2.12
NonEmptySetter: 1.73 seconds EmptySetter: 0.53 seconds
Output for 5.2.11
NonEmptySetter: 1.32 seconds EmptySetter: 1.04 seconds
Output for 5.2.10
NonEmptySetter: 1.59 seconds
Process exited with code 137.
Output for 5.2.8
NonEmptySetter: 2.04 seconds
Process exited with code 137.
Output for 5.0.5, 5.2.7
NonEmptySetter: 1.66 seconds
Process exited with code 137.
Output for 5.2.6
NonEmptySetter: 1.66 seconds EmptySetter: 0.54 seconds
Output for 5.2.5
NonEmptySetter: 1.25 seconds EmptySetter: 0.44 seconds
Output for 5.2.4
NonEmptySetter: 1.51 seconds EmptySetter: 0.57 seconds
Output for 5.2.3
NonEmptySetter: 1.70 seconds EmptySetter: 0.55 seconds
Output for 5.2.2
NonEmptySetter: 1.22 seconds EmptySetter: 0.83 seconds
Output for 5.2.1
NonEmptySetter: 1.55 seconds EmptySetter: 0.41 seconds
Output for 5.0.1, 5.2.0
NonEmptySetter: 1.77 seconds
Process exited with code 137.
Output for 5.1.6
NonEmptySetter: 1.49 seconds EmptySetter: 0.73 seconds
Output for 5.1.5
NonEmptySetter: 1.36 seconds EmptySetter: 0.43 seconds
Output for 5.1.4
NonEmptySetter: 1.17 seconds EmptySetter: 0.57 seconds
Output for 5.1.3
NonEmptySetter: 1.45 seconds EmptySetter: 0.51 seconds
Output for 5.1.2
NonEmptySetter: 1.28 seconds EmptySetter: 0.86 seconds
Output for 5.1.1
NonEmptySetter: 1.18 seconds EmptySetter: 0.68 seconds
Output for 5.1.0
NonEmptySetter: 1.26 seconds EmptySetter: 0.48 seconds
Output for 5.0.4
NonEmptySetter: 1.68 seconds EmptySetter: 0.74 seconds
Output for 5.0.3
NonEmptySetter: 1.50 seconds EmptySetter: 0.88 seconds
Output for 5.0.2
NonEmptySetter: 1.65 seconds EmptySetter: 0.76 seconds
Output for 5.0.0
NonEmptySetter: 1.81 seconds
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/B3TE3 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/B3TE3 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/B3TE3 on line 3
Process exited with code 255.