3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $t = "Ut bibendum velit ut scelerisque ultrices. Sed convallis, lorem et sagittis gravida, arcu urna pharetra metus, commodo gravida nibh diam et arcu. Sed eget ante ac libero porttitor elementum. Curabitur leo leo, posuere et purus ut, elementum porttitor est. Aenean ut porttitor nisl. Curabitur mollis est at nisl ultricies suscipit. Nullam eu turpis lobortis, pretium orci sed, porttitor enim. Cras dignissim aliquet sollicitudin. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nulla nec tortor odio. Vestibulum ut nisl vitae ante tempor egestas quis a velit. Nam ullamcorper molestie lorem, vitae convallis libero tincidunt eget. Sed in massa vitae lacus posuere scelerisque id ac sapien. Nam leo ipsum, lobortis non leo et, sagittis varius massa. Nunc tellus turpis, egestas quis nunc a, suscipit vulputate massa."; $w = explode(' ', $t); array_walk($w, function(&$v){ $v = strtolower(str_replace(['.', ','], '', $v)); }); var_dump($w);
Output for 5.4.0 - 7.1.0
array(126) { [0]=> string(2) "ut" [1]=> string(8) "bibendum" [2]=> string(5) "velit" [3]=> string(2) "ut" [4]=> string(11) "scelerisque" [5]=> string(8) "ultrices" [6]=> string(3) "sed" [7]=> string(9) "convallis" [8]=> string(5) "lorem" [9]=> string(2) "et" [10]=> string(8) "sagittis" [11]=> string(7) "gravida" [12]=> string(4) "arcu" [13]=> string(4) "urna" [14]=> string(8) "pharetra" [15]=> string(5) "metus" [16]=> string(7) "commodo" [17]=> string(7) "gravida" [18]=> string(4) "nibh" [19]=> string(4) "diam" [20]=> string(2) "et" [21]=> string(4) "arcu" [22]=> string(3) "sed" [23]=> string(4) "eget" [24]=> string(4) "ante" [25]=> string(2) "ac" [26]=> string(6) "libero" [27]=> string(9) "porttitor" [28]=> string(9) "elementum" [29]=> string(9) "curabitur" [30]=> string(3) "leo" [31]=> string(3) "leo" [32]=> string(7) "posuere" [33]=> string(2) "et" [34]=> string(5) "purus" [35]=> string(2) "ut" [36]=> string(9) "elementum" [37]=> string(9) "porttitor" [38]=> string(3) "est" [39]=> string(6) "aenean" [40]=> string(2) "ut" [41]=> string(9) "porttitor" [42]=> string(4) "nisl" [43]=> string(9) "curabitur" [44]=> string(6) "mollis" [45]=> string(3) "est" [46]=> string(2) "at" [47]=> string(4) "nisl" [48]=> string(9) "ultricies" [49]=> string(8) "suscipit" [50]=> string(6) "nullam" [51]=> string(2) "eu" [52]=> string(6) "turpis" [53]=> string(8) "lobortis" [54]=> string(7) "pretium" [55]=> string(4) "orci" [56]=> string(3) "sed" [57]=> string(9) "porttitor" [58]=> string(4) "enim" [59]=> string(4) "cras" [60]=> string(9) "dignissim" [61]=> string(7) "aliquet" [62]=> string(12) "sollicitudin" [63]=> string(8) "interdum" [64]=> string(2) "et" [65]=> string(9) "malesuada" [66]=> string(5) "fames" [67]=> string(2) "ac" [68]=> string(4) "ante" [69]=> string(5) "ipsum" [70]=> string(6) "primis" [71]=> string(2) "in" [72]=> string(8) "faucibus" [73]=> string(5) "nulla" [74]=> string(3) "nec" [75]=> string(6) "tortor" [76]=> string(4) "odio" [77]=> string(10) "vestibulum" [78]=> string(2) "ut" [79]=> string(4) "nisl" [80]=> string(5) "vitae" [81]=> string(4) "ante" [82]=> string(6) "tempor" [83]=> string(7) "egestas" [84]=> string(4) "quis" [85]=> string(1) "a" [86]=> string(5) "velit" [87]=> string(3) "nam" [88]=> string(11) "ullamcorper" [89]=> string(8) "molestie" [90]=> string(5) "lorem" [91]=> string(5) "vitae" [92]=> string(9) "convallis" [93]=> string(6) "libero" [94]=> string(9) "tincidunt" [95]=> string(4) "eget" [96]=> string(3) "sed" [97]=> string(2) "in" [98]=> string(5) "massa" [99]=> string(5) "vitae" [100]=> string(5) "lacus" [101]=> string(7) "posuere" [102]=> string(11) "scelerisque" [103]=> string(2) "id" [104]=> string(2) "ac" [105]=> string(6) "sapien" [106]=> string(3) "nam" [107]=> string(3) "leo" [108]=> string(5) "ipsum" [109]=> string(8) "lobortis" [110]=> string(3) "non" [111]=> string(3) "leo" [112]=> string(2) "et" [113]=> string(8) "sagittis" [114]=> string(6) "varius" [115]=> string(5) "massa" [116]=> string(4) "nunc" [117]=> string(6) "tellus" [118]=> string(6) "turpis" [119]=> string(7) "egestas" [120]=> string(4) "quis" [121]=> string(4) "nunc" [122]=> string(1) "a" [123]=> string(8) "suscipit" [124]=> string(9) "vulputate" [125]=> string(5) "massa" }
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/7KX93 on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/7KX93 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/7KX93 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/7KX93 on line 6
Process exited with code 255.