Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Exemplo de lista de compras para discussão thread safe, parallel programming
<?php
Class Compras
{
private $lista = array();
public add($item)
{
$this->lista[] = $item;
}
public remove($index)
{
unset($this->lista[$index]);
}
public countItems()
{
return count($this->lista);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment