Output of the "Ordering a PHP array of objects by a given property" PHP snippet

Environment:

  • Strangebuzz Snippet VM: 6.4.2
  • PHP: 8.3

Code execution output:

array(4) {
  [0]=>
  object(App\Samples\SortableObject)#1902 (1) {
    ["name"]=>
    string(4) "blue"
  }
  [1]=>
  object(App\Samples\SortableObject)#1899 (1) {
    ["name"]=>
    string(5) "green"
  }
  [2]=>
  object(App\Samples\SortableObject)#1901 (1) {
    ["name"]=>
    string(6) "orange"
  }
  [3]=>
  object(App\Samples\SortableObject)#1900 (1) {
    ["name"]=>
    string(6) "yellow"
  }
}
array(4) {
  [0]=>
  object(App\Samples\SortableObject)#1900 (1) {
    ["name"]=>
    string(6) "yellow"
  }
  [1]=>
  object(App\Samples\SortableObject)#1899 (1) {
    ["name"]=>
    string(5) "green"
  }
  [2]=>
  object(App\Samples\SortableObject)#1901 (1) {
    ["name"]=>
    string(6) "orange"
  }
  [3]=>
  object(App\Samples\SortableObject)#1902 (1) {
    ["name"]=>
    string(4) "blue"
  }
}
array(4) {
  [0]=>
  object(App\Samples\SortableObject)#1902 (1) {
    ["name"]=>
    string(4) "blue"
  }
  [1]=>
  object(App\Samples\SortableObject)#1899 (1) {
    ["name"]=>
    string(5) "green"
  }
  [2]=>
  object(App\Samples\SortableObject)#1901 (1) {
    ["name"]=>
    string(6) "orange"
  }
  [3]=>
  object(App\Samples\SortableObject)#1900 (1) {
    ["name"]=>
    string(6) "yellow"
  }
}