3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = new SplPriorityQueue(); $a->insert(new stdClass, 3); $a->insert(array(), 2); $a->insert(new DateTime, 5); var_dump(count($a)); var_dump(iterator_to_array($a)); var_dump(count($a));
Output for 7.1.0
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2014-04-10 16:31:53.006166" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.28, 7.0.14
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2014-04-10 16:31:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.6
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-21 20:51:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.5
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 15:42:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.4
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 01:12:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.3
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 01:22:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.2
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 11:57:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.1
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 12:10:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 7.0.0
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-26 14:39:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for hhvm-3.12.0
int(3) array(3) { [2]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-11 05:49:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for hhvm-3.10.0
int(3) array(3) { [2]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-29 19:41:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.21
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 22:40:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.20
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-09 10:54:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.19
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-06 23:28:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.18
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-14 11:31:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.17
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-19 05:51:22.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.16
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 16:24:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.15
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 17:17:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.14
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 19:56:01.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.13
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-14 23:43:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.12
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-19 12:53:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.11
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 20:09:41.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.10
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 21:03:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.9
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-28 03:03:50.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.6.8
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 10:49:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.35
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-23 13:27:36.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.34
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 16:50:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.33
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 12:03:53.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.32
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-16 17:45:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.31
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 08:44:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.30
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-31 19:19:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.29
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-16 13:51:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.28
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 16:09:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.27
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 18:40:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.26
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 23:45:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.25
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 07:20:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.5.24
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 14:28:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.45
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-09-19 23:04:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.44
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-09-19 23:04:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.43
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-07-13 13:30:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.42
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-07-13 13:30:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.41
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-07-13 13:30:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.39 - 5.4.40
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-05-15 09:41:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.38
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-03-02 20:37:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.35 - 5.4.37
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-02-09 02:00:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.34
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2015-02-09 02:00:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.32
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2014-09-09 00:05:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.31
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2014-09-09 00:05:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.30
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(26) "2014-09-09 00:05:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.29
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-09-09 00:05:07" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.28
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-09-09 00:05:05" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.26 - 5.4.27
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:53" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.5 - 5.4.25
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:54" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.4.4
int(3) array(3) { [3]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:54" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [2]=> object(stdClass)#2 (0) { } [1]=> array(0) { } } int(0)
Output for 5.3.12 - 5.3.14, 5.4.0 - 5.4.3
int(3) array(3) { [3]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [2]=> object(stdClass)#2 (0) { } [1]=> array(0) { } } int(0)
Output for 5.3.29
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-09-09 00:05:08" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.3.15 - 5.3.28
int(3) array(3) { [2]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:55" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [1]=> object(stdClass)#2 (0) { } [0]=> array(0) { } } int(0)
Output for 5.3.0 - 5.3.11
int(3) array(3) { [3]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2014-04-10 16:31:56" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } [2]=> object(stdClass)#2 (0) { } [1]=> array(0) { } } int(0)
Output for 5.0.0 - 5.2.17
Fatal error: Class 'SplPriorityQueue' not found in /in/tdgHU on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: splpriorityqueue in /in/tdgHU on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: splpriorityqueue in /in/tdgHU on line 3