3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class EmptySetter { 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.1.0
NonEmptySetter: 0.25 seconds EmptySetter: 0.16 seconds
Output for 7.0.14
NonEmptySetter: 0.25 seconds EmptySetter: 0.20 seconds
Output for 7.0.6
NonEmptySetter: 0.33 seconds EmptySetter: 0.25 seconds
Output for 7.0.1, 7.0.4 - 7.0.5
NonEmptySetter: 0.31 seconds EmptySetter: 0.24 seconds
Output for 7.0.3
NonEmptySetter: 0.29 seconds EmptySetter: 0.24 seconds
Output for 7.0.0, 7.0.2
NonEmptySetter: 0.32 seconds EmptySetter: 0.24 seconds
Output for 5.6.13, 5.6.21
NonEmptySetter: 0.57 seconds EmptySetter: 0.44 seconds
Output for 5.6.10 - 5.6.12, 5.6.14, 5.6.17, 5.6.20
NonEmptySetter: 0.56 seconds EmptySetter: 0.44 seconds
Output for 5.6.19
NonEmptySetter: 0.52 seconds EmptySetter: 0.43 seconds
Output for 5.6.18
NonEmptySetter: 0.50 seconds EmptySetter: 0.39 seconds
Output for 5.6.16
NonEmptySetter: 0.57 seconds EmptySetter: 0.47 seconds
Output for 5.5.27, 5.5.35, 5.6.15
NonEmptySetter: 0.55 seconds EmptySetter: 0.43 seconds
Output for 5.6.9
NonEmptySetter: 0.58 seconds EmptySetter: 0.44 seconds
Output for 5.6.8
NonEmptySetter: 0.54 seconds EmptySetter: 0.44 seconds
Output for 5.5.34
NonEmptySetter: 0.58 seconds EmptySetter: 0.45 seconds
Output for 5.5.33
NonEmptySetter: 0.51 seconds EmptySetter: 0.40 seconds
Output for 5.5.30, 5.5.32
NonEmptySetter: 0.55 seconds EmptySetter: 0.44 seconds
Output for 5.5.31
NonEmptySetter: 0.59 seconds EmptySetter: 0.46 seconds
Output for 5.5.29
NonEmptySetter: 0.57 seconds EmptySetter: 0.46 seconds
Output for 5.5.28
NonEmptySetter: 0.56 seconds EmptySetter: 0.46 seconds
Output for 5.5.26
NonEmptySetter: 0.65 seconds EmptySetter: 0.49 seconds
Output for 5.5.25
NonEmptySetter: 0.68 seconds EmptySetter: 0.51 seconds
Output for 5.5.24
NonEmptySetter: 0.58 seconds EmptySetter: 0.41 seconds
Output for 5.4.45
NonEmptySetter: 0.84 seconds EmptySetter: 0.62 seconds
Output for 5.4.44
NonEmptySetter: 0.77 seconds EmptySetter: 0.61 seconds
Output for 5.4.43
NonEmptySetter: 0.73 seconds EmptySetter: 0.58 seconds
Output for 5.4.42
NonEmptySetter: 0.72 seconds EmptySetter: 0.56 seconds
Output for 5.4.41
NonEmptySetter: 0.88 seconds EmptySetter: 0.71 seconds
Output for 5.4.40
NonEmptySetter: 0.89 seconds EmptySetter: 0.64 seconds
Output for 5.4.39
NonEmptySetter: 0.87 seconds EmptySetter: 0.63 seconds
Output for 5.4.38
NonEmptySetter: 0.78 seconds EmptySetter: 0.58 seconds
Output for 5.4.37
NonEmptySetter: 0.61 seconds EmptySetter: 0.46 seconds
Output for 5.4.36
NonEmptySetter: 0.86 seconds EmptySetter: 0.74 seconds
Output for 5.4.28, 5.4.35
NonEmptySetter: 0.60 seconds EmptySetter: 0.47 seconds
Output for 5.4.34
NonEmptySetter: 0.64 seconds EmptySetter: 0.47 seconds
Output for 5.4.32
NonEmptySetter: 0.58 seconds EmptySetter: 0.49 seconds
Output for 5.4.31
NonEmptySetter: 0.57 seconds EmptySetter: 0.43 seconds
Output for 5.4.30
NonEmptySetter: 0.60 seconds EmptySetter: 0.46 seconds
Output for 5.4.29
NonEmptySetter: 0.61 seconds EmptySetter: 0.50 seconds
Output for 5.4.27
NonEmptySetter: 1.12 seconds EmptySetter: 0.53 seconds
Output for 5.4.26
NonEmptySetter: 0.62 seconds EmptySetter: 0.49 seconds
Output for 5.4.25
NonEmptySetter: 0.69 seconds EmptySetter: 0.53 seconds
Output for 5.4.24
NonEmptySetter: 0.92 seconds EmptySetter: 0.55 seconds
Output for 5.4.23
NonEmptySetter: 0.78 seconds EmptySetter: 0.56 seconds
Output for 5.4.22
NonEmptySetter: 0.98 seconds EmptySetter: 0.50 seconds
Output for 5.4.21
NonEmptySetter: 0.83 seconds EmptySetter: 0.67 seconds
Output for 5.4.20
NonEmptySetter: 0.95 seconds EmptySetter: 1.01 seconds
Output for 5.4.19
NonEmptySetter: 0.80 seconds EmptySetter: 0.50 seconds
Output for 5.4.18
NonEmptySetter: 0.77 seconds EmptySetter: 0.64 seconds
Output for 5.4.17
NonEmptySetter: 1.24 seconds EmptySetter: 0.65 seconds
Output for 5.4.16
NonEmptySetter: 0.84 seconds EmptySetter: 0.70 seconds
Output for 5.4.15
NonEmptySetter: 0.83 seconds EmptySetter: 0.57 seconds
Output for 5.4.14
NonEmptySetter: 1.15 seconds EmptySetter: 0.84 seconds
Output for 5.4.13
NonEmptySetter: 1.06 seconds EmptySetter: 0.95 seconds
Output for 5.4.12
NonEmptySetter: 0.68 seconds EmptySetter: 0.50 seconds
Output for 5.4.11
NonEmptySetter: 0.74 seconds EmptySetter: 0.67 seconds
Output for 5.4.10
NonEmptySetter: 1.05 seconds EmptySetter: 0.56 seconds
Output for 5.4.9
NonEmptySetter: 1.00 seconds EmptySetter: 0.66 seconds
Output for 5.4.8
NonEmptySetter: 0.64 seconds EmptySetter: 0.49 seconds
Output for 5.4.7
NonEmptySetter: 0.80 seconds EmptySetter: 0.64 seconds
Output for 5.4.6
NonEmptySetter: 1.13 seconds EmptySetter: 0.58 seconds
Output for 5.4.5
NonEmptySetter: 0.81 seconds EmptySetter: 0.63 seconds
Output for 5.4.4
NonEmptySetter: 1.15 seconds EmptySetter: 0.61 seconds
Output for 5.4.3
NonEmptySetter: 0.73 seconds EmptySetter: 0.73 seconds
Output for 5.4.2
NonEmptySetter: 1.27 seconds EmptySetter: 0.76 seconds
Output for 5.4.1
NonEmptySetter: 0.74 seconds EmptySetter: 0.88 seconds
Output for 5.4.0
NonEmptySetter: 1.35 seconds EmptySetter: 0.63 seconds
Output for 5.3.29
NonEmptySetter: 0.60 seconds EmptySetter: 0.55 seconds
Output for 5.3.28
NonEmptySetter: 0.70 seconds EmptySetter: 0.62 seconds
Output for 5.3.27
NonEmptySetter: 0.75 seconds EmptySetter: 0.61 seconds
Output for 5.3.26
NonEmptySetter: 0.77 seconds EmptySetter: 0.55 seconds
Output for 5.3.25
NonEmptySetter: 0.78 seconds EmptySetter: 0.53 seconds
Output for 5.3.24
NonEmptySetter: 0.81 seconds EmptySetter: 0.61 seconds
Output for 5.3.23
NonEmptySetter: 0.64 seconds EmptySetter: 0.61 seconds
Output for 5.3.22
NonEmptySetter: 0.66 seconds EmptySetter: 0.59 seconds
Output for 5.3.21
NonEmptySetter: 0.69 seconds EmptySetter: 0.68 seconds
Output for 5.3.20
NonEmptySetter: 0.78 seconds EmptySetter: 0.59 seconds
Output for 5.3.19
NonEmptySetter: 0.79 seconds EmptySetter: 0.64 seconds
Output for 5.3.18
NonEmptySetter: 0.67 seconds EmptySetter: 0.58 seconds
Output for 5.3.17
NonEmptySetter: 0.73 seconds EmptySetter: 0.61 seconds
Output for 5.3.16
NonEmptySetter: 0.86 seconds EmptySetter: 0.67 seconds
Output for 5.3.15
NonEmptySetter: 0.92 seconds EmptySetter: 0.66 seconds
Output for 5.3.14
NonEmptySetter: 0.94 seconds EmptySetter: 0.74 seconds
Output for 5.3.13
NonEmptySetter: 0.72 seconds EmptySetter: 0.67 seconds
Output for 5.3.12
NonEmptySetter: 0.65 seconds EmptySetter: 0.63 seconds
Output for 5.3.11
NonEmptySetter: 0.66 seconds EmptySetter: 0.68 seconds
Output for 5.3.10
NonEmptySetter: 0.75 seconds EmptySetter: 0.65 seconds
Output for 5.3.9
NonEmptySetter: 0.66 seconds EmptySetter: 0.82 seconds
Output for 5.3.8
NonEmptySetter: 0.90 seconds EmptySetter: 0.85 seconds
Output for 5.3.7
NonEmptySetter: 0.83 seconds EmptySetter: 0.63 seconds
Output for 5.3.6
NonEmptySetter: 0.95 seconds EmptySetter: 0.81 seconds
Output for 5.3.5
NonEmptySetter: 0.79 seconds EmptySetter: 0.73 seconds
Output for 5.3.4
NonEmptySetter: 0.67 seconds EmptySetter: 0.59 seconds
Output for 5.3.3
NonEmptySetter: 0.68 seconds EmptySetter: 0.59 seconds
Output for 5.3.2
NonEmptySetter: 0.66 seconds EmptySetter: 0.60 seconds
Output for 5.3.1
NonEmptySetter: 0.73 seconds EmptySetter: 0.63 seconds
Output for 5.3.0
NonEmptySetter: 0.80 seconds EmptySetter: 0.63 seconds
Output for 5.2.17
NonEmptySetter: 0.97 seconds EmptySetter: 0.81 seconds
Output for 5.2.16
NonEmptySetter: 0.83 seconds EmptySetter: 0.74 seconds
Output for 5.2.15
NonEmptySetter: 0.96 seconds EmptySetter: 0.81 seconds
Output for 5.2.14
NonEmptySetter: 0.82 seconds EmptySetter: 0.75 seconds
Output for 5.2.13
NonEmptySetter: 0.81 seconds EmptySetter: 0.66 seconds
Output for 5.2.12
NonEmptySetter: 0.94 seconds EmptySetter: 0.67 seconds
Output for 5.2.11
NonEmptySetter: 1.13 seconds EmptySetter: 1.04 seconds
Output for 5.2.10
NonEmptySetter: 1.27 seconds EmptySetter: 0.67 seconds
Output for 5.2.9
NonEmptySetter: 0.74 seconds EmptySetter: 0.64 seconds
Output for 5.2.8
NonEmptySetter: 0.82 seconds EmptySetter: 0.76 seconds
Output for 5.2.7
NonEmptySetter: 0.75 seconds EmptySetter: 0.71 seconds
Output for 5.2.6
NonEmptySetter: 0.82 seconds EmptySetter: 0.68 seconds
Output for 5.2.3, 5.2.5
NonEmptySetter: 0.78 seconds EmptySetter: 0.67 seconds
Output for 5.2.4
NonEmptySetter: 0.77 seconds EmptySetter: 0.68 seconds
Output for 5.2.2
NonEmptySetter: 0.79 seconds EmptySetter: 0.75 seconds
Output for 5.2.1
NonEmptySetter: 0.73 seconds EmptySetter: 0.66 seconds
Output for 5.2.0
NonEmptySetter: 0.77 seconds EmptySetter: 0.67 seconds
Output for 5.1.3, 5.1.6
NonEmptySetter: 0.68 seconds EmptySetter: 0.57 seconds
Output for 5.1.5
NonEmptySetter: 0.67 seconds EmptySetter: 0.57 seconds
Output for 5.1.4
NonEmptySetter: 0.70 seconds EmptySetter: 0.61 seconds
Output for 5.1.2
NonEmptySetter: 0.68 seconds EmptySetter: 0.55 seconds
Output for 5.1.1
NonEmptySetter: 0.67 seconds EmptySetter: 0.56 seconds
Output for 5.1.0
NonEmptySetter: 0.65 seconds EmptySetter: 0.56 seconds
Output for 5.0.5
NonEmptySetter: 1.02 seconds EmptySetter: 0.83 seconds
Output for 5.0.4
NonEmptySetter: 1.06 seconds EmptySetter: 0.84 seconds
Output for 5.0.3
NonEmptySetter: 1.03 seconds EmptySetter: 0.75 seconds
Output for 5.0.2
NonEmptySetter: 1.02 seconds EmptySetter: 0.80 seconds
Output for 5.0.1
NonEmptySetter: 1.09 seconds EmptySetter: 0.80 seconds
Output for 5.0.0
NonEmptySetter: 1.08 seconds EmptySetter: 0.77 seconds
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/gVtSq 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/gVtSq 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/gVtSq on line 3
Process exited with code 255.