The concept of a nested array in Solidity doesn't always relate to a primitive definition such as uint[][]
or byte[][]
. It encapsulates single dimensional arrays which also contain data types in which they themselves use arrays to store internal values such as Bytes and Strings. When I refer to primitives in Solidity what I mean uint
, int
, bool
, byte
which are in essence different types of integers with different sizes. string
, bytes
, address
are just a few examples of data types which contain arrays and therefore a single array is in essence a nested array like string[]
or bytes[]
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X PATCH -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"datas":[ | |
{"firstName":"John", "lastName":"Doe"}, | |
{"firstName":"Anna", "lastName":{"MAPS":"Smith"}}, | |
{"firstName":"Peter", "beans":213} | |
]}' "https://localhost/rest/test-patch/1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zend_class_entry *hooker_bot_4000; | |
ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0) | |
ZEND_END_ARG_INFO() | |
const zend_function_entry hb4_functions[] = { | |
PHP_ABSTRACT_ME(HookerBot4000, hookerBot4000, arginfo_void) | |
PHP_FE_END | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract Array { | |
uint[] arr; | |
function setup() internal { | |
arr.push(1); | |
arr.push(3); | |
arr.push(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract DataConversions { | |
uint[] _storage1; | |
function store() public { | |
_storage1.push(1); | |
_storage1.push(2); | |
_storage1.push(3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
contract Contract1 { | |
function call1() public pure returns(bool) { | |
return true; | |
} | |
} | |
contract Contract2 { | |
function call2() public pure returns(string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"nonce": "0x0000000000000042", | |
"timestamp": "0x0", | |
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", | |
"extraData": "0x0", | |
"gasLimit": "0x8000000", | |
"difficulty": "0x400", | |
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000", | |
"coinbase": "0x3333333333333333333333333333333333333333", | |
"alloc": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
import "github.com/willitscale/solidity-util/lib/Strings.sol"; | |
contract MapExample { | |
using Strings for string; | |
// This would be the same as mapping(string => uint) | |
string[] mapKeys; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyClass { | |
function __invoke() | |
{ | |
echo 'invoked as a function', PHP_EOL; | |
} | |
} | |
$object = new MyClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Components\Example; | |
class EasyToTest extends Sample | |
{ | |
public function __construct( | |
NestedObjectA $nestedObjectA, | |
NestedObjectB $nestedObjectB | |
) { |
OlderNewer