3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $m = new Memcached(); $m->addServer('localhost', 11211); $m->set('counter', 5); $n = $m->decrement('counter'); var_dump($n); $n = $m->decrement('counter', 10); var_dump($n); var_dump($m->get('counter')); $m->set('counter', 'abc'); $n = $m->increment('counter'); // ^ will fail due to item value not being numeric var_dump($n); ?>
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Class 'Memcached' not found in /in/XhZO9:2 Stack trace: #0 {main} thrown in /in/XhZO9 on line 2
Process exited with code 255.
Output for 5.0.0 - 5.6.28
Fatal error: Class 'Memcached' not found in /in/XhZO9 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: memcached in /in/XhZO9 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: memcached in /in/XhZO9 on line 2