diff --git a/examples/src/client/asyncInvoke.php b/examples/src/client/asyncInvoke.php new file mode 100644 index 00000000..9a88e93a --- /dev/null +++ b/examples/src/client/asyncInvoke.php @@ -0,0 +1,17 @@ +sum(1, 2) + ->then(function($result) use ($client) { + return $client->sum($result, 3); + }) + ->then(function($result) use ($client) { + return $client->sum($result, 4); + }) + ->then(function($result) { + var_dump($result); + }); \ No newline at end of file diff --git a/examples/src/client/asyncInvoke1.php b/examples/src/client/asyncInvoke1.php new file mode 100644 index 00000000..648bc59c --- /dev/null +++ b/examples/src/client/asyncInvoke1.php @@ -0,0 +1,12 @@ +sum($client->sum($client->sum(1, 2), 3), 4) + ->then(function($result) { + var_dump($result); + }); + \ No newline at end of file diff --git a/examples/src/client/asyncInvoke2.php b/examples/src/client/asyncInvoke2.php new file mode 100644 index 00000000..45f59778 --- /dev/null +++ b/examples/src/client/asyncInvoke2.php @@ -0,0 +1,12 @@ +sum; + +$var_dump($sum($sum($sum(1, 2), 3), 4)); \ No newline at end of file diff --git a/examples/src/client/asyncInvoke3.php b/examples/src/client/asyncInvoke3.php new file mode 100644 index 00000000..dc7d49a6 --- /dev/null +++ b/examples/src/client/asyncInvoke3.php @@ -0,0 +1,15 @@ +sum; + +$r1 = $sum(1, 3, 5, 7, 9); +$r2 = $sum(2, 4, 6, 8, 10); +$r3 = $sum($r1, $r2); +$var_dump($r1, $r2, $r3); \ No newline at end of file diff --git a/examples/src/client/byref.php b/examples/src/client/byref.php new file mode 100644 index 00000000..cdd74c62 --- /dev/null +++ b/examples/src/client/byref.php @@ -0,0 +1,25 @@ + 'Mon', + 'Tuesday' => 'Tue', + 'Wednesday' => 'Wed', + 'Thursday' => 'Thu', + 'Friday' => 'Fri', + 'Saturday' => 'Sat', + 'Sunday' => 'Sun' +); + +$args = array($weeks); +$client->invoke('swapKeyAndValue', $args, new InvokeSettings(array('byref' => true))); +var_dump($args[0]); + +$client->swapKeyAndValue($weeks, function($result, $args) { + var_dump($args[0]); +}, array('byref' => true)); \ No newline at end of file diff --git a/examples/src/client/byref1.php b/examples/src/client/byref1.php new file mode 100644 index 00000000..5139370e --- /dev/null +++ b/examples/src/client/byref1.php @@ -0,0 +1,23 @@ + 'Mon', + 'Tuesday' => 'Tue', + 'Wednesday' => 'Wed', + 'Thursday' => 'Thu', + 'Friday' => 'Fri', + 'Saturday' => 'Sat', + 'Sunday' => 'Sun' +); + +$args = array($weeks); + +$client->swapKeyAndValue["byref"] = true; +$client->swapKeyAndValue($weeks, function($result, $args) { + var_dump($args[0]); +}); \ No newline at end of file diff --git a/examples/src/client/mode.php b/examples/src/client/mode.php new file mode 100644 index 00000000..c5faf3c3 --- /dev/null +++ b/examples/src/client/mode.php @@ -0,0 +1,13 @@ +hello("World", new InvokeSettings(array('mode' => ResultMode::Normal)))); +var_dump($client->hello("World", new InvokeSettings(array('mode' => ResultMode::Serialized)))); +var_dump($client->hello("World", new InvokeSettings(array('mode' => ResultMode::Raw)))); +var_dump($client->hello("World", new InvokeSettings(array('mode' => ResultMode::RawWithEndTag))));