From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- tests/basic/001.phpt | 6 + tests/basic/002.phpt | 9 + tests/basic/003.phpt | 12 + tests/basic/004.phpt | 10 + tests/basic/005.phpt | 10 + tests/basic/006.phpt | 6 + tests/basic/007.phpt | 6 + tests/basic/008.phpt | 6 + tests/basic/009.phpt | 6 + tests/basic/010.phpt | 6 + tests/basic/011.phpt | 22 + tests/basic/012.phpt | 25 + tests/basic/013.phpt | 13 + tests/basic/014.phpt | 15 + tests/basic/015.phpt | 13 + tests/basic/016.phpt | 15 + tests/basic/017.phpt | 17 + tests/basic/018.phpt | 34 + tests/basic/019.phpt | 17 + tests/basic/020.phpt | 15 + tests/basic/021.phpt | 43 + tests/basic/022.phpt | 34 + tests/basic/023.phpt | 20 + tests/basic/024.phpt | 28 + tests/basic/025.phpt | 20 + tests/basic/026.phpt | 15 + tests/basic/027.phpt | 33 + tests/basic/028.phpt | 105 + tests/basic/029.phpt | 51 + tests/basic/030.phpt | 20 + tests/basic/031.phpt | 32 + tests/basic/032.phpt | 20 + tests/basic/bug20539.phpt | 20 + tests/basic/bug29971.phpt | 15 + tests/basic/bug45986.phpt | 12 + tests/basic/bug51709_1.phpt | 16 + tests/basic/bug51709_2.phpt | 16 + tests/basic/bug53180.phpt | 19 + tests/basic/bug54514.phpt | 12 + tests/basic/bug55500.phpt | 68 + tests/basic/bug61000.phpt | 19 + tests/basic/enable_post_data_reading_01.phpt | 22 + tests/basic/enable_post_data_reading_02.phpt | 28 + tests/basic/enable_post_data_reading_03.phpt | 23 + tests/basic/enable_post_data_reading_04.phpt | 23 + tests/basic/php_egg_logo_guid.phpt | 13 + tests/basic/php_logo_guid.phpt | 10 + tests/basic/php_real_logo_guid.phpt | 12 + tests/basic/req44164.phpt | 17 + tests/basic/rfc1867_anonymous_upload.phpt | 57 + tests/basic/rfc1867_array_upload.phpt | 84 + tests/basic/rfc1867_boundary_1.phpt | 25 + tests/basic/rfc1867_boundary_2.phpt | 25 + tests/basic/rfc1867_empty_upload.phpt | 89 + tests/basic/rfc1867_file_upload_disabled.phpt | 36 + tests/basic/rfc1867_garbled_mime_headers.phpt | 25 + tests/basic/rfc1867_invalid_boundary.phpt | 24 + tests/basic/rfc1867_malicious_input.phpt | 25 + tests/basic/rfc1867_max_file_size.phpt | 89 + .../rfc1867_max_file_uploads_empty_files.phpt | 101 + ...rfc1867_max_file_uploads_empty_files_debug.phpt | 102 + tests/basic/rfc1867_missing_boundary.phpt | 24 + tests/basic/rfc1867_missing_boundary_2.phpt | 37 + tests/basic/rfc1867_post_max_filesize.phpt | 83 + tests/basic/rfc1867_post_max_size.phpt | 24 + tests/basic/zend_logo_guid.phpt | 13 + tests/classes/__call_001.phpt | 42 + tests/classes/__call_002.phpt | 15 + tests/classes/__call_003.phpt | 33 + tests/classes/__call_004.phpt | 41 + tests/classes/__call_005.phpt | 37 + tests/classes/__call_006.phpt | 77 + tests/classes/__call_007.phpt | 74 + tests/classes/__set__get_001.phpt | 72 + tests/classes/__set__get_002.phpt | 14 + tests/classes/__set__get_003.phpt | 14 + tests/classes/__set__get_004.phpt | 39 + tests/classes/__set__get_005.phpt | 68 + tests/classes/__set_data_corrupt.phpt | 29 + tests/classes/abstract.phpt | 30 + tests/classes/abstract_by_interface_001.phpt | 33 + tests/classes/abstract_by_interface_002.phpt | 33 + tests/classes/abstract_class.phpt | 29 + tests/classes/abstract_derived.phpt | 20 + tests/classes/abstract_final.phpt | 16 + tests/classes/abstract_inherit.phpt | 22 + tests/classes/abstract_not_declared.phpt | 15 + tests/classes/abstract_redeclare.phpt | 22 + tests/classes/abstract_static.phpt | 36 + tests/classes/abstract_user_call.phpt | 30 + tests/classes/array_access_001.phpt | 198 + tests/classes/array_access_002.phpt | 198 + tests/classes/array_access_003.phpt | 59 + tests/classes/array_access_004.phpt | 57 + tests/classes/array_access_005.phpt | 77 + tests/classes/array_access_006.phpt | 37 + tests/classes/array_access_007.phpt | 57 + tests/classes/array_access_008.phpt | 67 + tests/classes/array_access_009.phpt | 190 + tests/classes/array_access_010.phpt | 168 + tests/classes/array_access_011.phpt | 187 + tests/classes/array_access_012.phpt | 36 + tests/classes/array_access_013.phpt | 58 + tests/classes/arrayobject_001.phpt | 13 + tests/classes/assign_op_property_001.phpt | 31 + tests/classes/autoload_001.phpt | 24 + tests/classes/autoload_002.phpt | 27 + tests/classes/autoload_003.phpt | 25 + tests/classes/autoload_004.phpt | 28 + tests/classes/autoload_005.phpt | 45 + tests/classes/autoload_006.phpt | 40 + tests/classes/autoload_007.phpt | 15 + tests/classes/autoload_008.phpt | 26 + tests/classes/autoload_009.phpt | 20 + tests/classes/autoload_010.phpt | 18 + tests/classes/autoload_011.phpt | 18 + tests/classes/autoload_012.phpt | 15 + tests/classes/autoload_013.phpt | 22 + tests/classes/autoload_014.phpt | 22 + tests/classes/autoload_015.phpt | 22 + tests/classes/autoload_016.phpt | 23 + tests/classes/autoload_017.phpt | 23 + tests/classes/autoload_018.phpt | 48 + tests/classes/autoload_019.phpt | 14 + tests/classes/autoload_020.phpt | 17 + tests/classes/autoload_derived.p5c | 6 + tests/classes/autoload_implements.p5c | 10 + tests/classes/autoload_interface.p5c | 7 + tests/classes/autoload_root.p5c | 10 + tests/classes/bug23951.phpt | 44 + tests/classes/bug24399.phpt | 12 + tests/classes/bug24445.phpt | 12 + tests/classes/bug26737.phpt | 22 + tests/classes/bug27468.phpt | 17 + tests/classes/bug27504.phpt | 25 + tests/classes/bug29446.phpt | 19 + tests/classes/bug63462.phpt | 71 + tests/classes/class_abstract.phpt | 28 + tests/classes/class_example.phpt | 85 + tests/classes/class_final.phpt | 22 + tests/classes/class_stdclass.phpt | 14 + tests/classes/clone_001.phpt | 43 + tests/classes/clone_002.phpt | 45 + tests/classes/clone_003.phpt | 58 + tests/classes/clone_004.phpt | 82 + tests/classes/clone_005.phpt | 19 + tests/classes/clone_006.phpt | 41 + tests/classes/constants_basic_001.phpt | 89 + tests/classes/constants_basic_002.phpt | 32 + tests/classes/constants_basic_003.inc | 5 + tests/classes/constants_basic_003.phpt | 28 + tests/classes/constants_basic_004.phpt | 99 + tests/classes/constants_basic_005.phpt | 16 + tests/classes/constants_basic_006.phpt | 43 + tests/classes/constants_error_001.phpt | 13 + tests/classes/constants_error_002.phpt | 12 + tests/classes/constants_error_003.phpt | 20 + tests/classes/constants_error_004.phpt | 13 + tests/classes/constants_error_005.phpt | 12 + tests/classes/constants_error_006.phpt | 16 + tests/classes/constants_error_007.phpt | 15 + tests/classes/constants_scope_001.phpt | 38 + tests/classes/ctor_dtor.phpt | 40 + tests/classes/ctor_dtor_inheritance.phpt | 99 + tests/classes/ctor_failure.phpt | 33 + tests/classes/ctor_in_interface_01.phpt | 19 + tests/classes/ctor_in_interface_02.phpt | 34 + tests/classes/ctor_in_interface_03.phpt | 23 + tests/classes/ctor_in_interface_04.phpt | 26 + tests/classes/ctor_name_clash.phpt | 22 + tests/classes/ctor_visibility.phpt | 69 + tests/classes/dereferencing_001.phpt | 35 + tests/classes/destructor_and_echo.phpt | 24 + tests/classes/destructor_and_exceptions.phpt | 60 + tests/classes/destructor_and_globals.phpt | 56 + tests/classes/destructor_and_references.phpt | 26 + tests/classes/destructor_inheritance.phpt | 29 + tests/classes/destructor_visibility_001.phpt | 24 + tests/classes/destructor_visibility_002.phpt | 24 + tests/classes/destructor_visibility_003.phpt | 28 + tests/classes/factory_001.phpt | 35 + tests/classes/factory_and_singleton_001.phpt | 101 + tests/classes/factory_and_singleton_002.phpt | 100 + tests/classes/factory_and_singleton_003.phpt | 18 + tests/classes/factory_and_singleton_004.phpt | 18 + tests/classes/factory_and_singleton_005.phpt | 19 + tests/classes/factory_and_singleton_006.phpt | 20 + tests/classes/factory_and_singleton_007.phpt | 20 + tests/classes/factory_and_singleton_008.phpt | 20 + tests/classes/factory_and_singleton_009.phpt | 21 + tests/classes/factory_and_singleton_010.phpt | 21 + tests/classes/final.phpt | 31 + tests/classes/final_abstract.phpt | 16 + tests/classes/final_ctor1.phpt | 29 + tests/classes/final_ctor2.phpt | 29 + tests/classes/final_ctor3.phpt | 13 + tests/classes/final_redeclare.phpt | 25 + tests/classes/implicit_instantiation_001.phpt | 146 + tests/classes/incdec_property_001.phpt | 31 + tests/classes/incdec_property_002.phpt | 31 + tests/classes/incdec_property_003.phpt | 31 + tests/classes/incdec_property_004.phpt | 31 + tests/classes/inheritance.phpt | 56 + tests/classes/inheritance_002.phpt | 71 + tests/classes/inheritance_003.phpt | 21 + tests/classes/inheritance_004.phpt | 21 + tests/classes/inheritance_005.phpt | 57 + tests/classes/inheritance_006.phpt | 24 + tests/classes/inheritance_007.phpt | 39 + tests/classes/interface_and_extends.phpt | 26 + tests/classes/interface_class.phpt | 14 + .../interface_constant_inheritance_001.phpt | 17 + .../interface_constant_inheritance_002.phpt | 17 + .../interface_constant_inheritance_003.phpt | 20 + .../interface_constant_inheritance_004.phpt | 18 + tests/classes/interface_doubled.phpt | 201 + tests/classes/interface_implemented.phpt | 103 + tests/classes/interface_instantiate.phpt | 16 + tests/classes/interface_member.phpt | 13 + tests/classes/interface_method.phpt | 15 + tests/classes/interface_method_final.phpt | 15 + tests/classes/interface_method_private.phpt | 15 + tests/classes/interface_must_be_implemented.phpt | 17 + tests/classes/interface_optional_arg.phpt | 27 + tests/classes/interface_optional_arg_002.phpt | 24 + tests/classes/interface_optional_arg_003.inc | 4 + tests/classes/interface_optional_arg_003.phpt | 17 + tests/classes/interfaces_001.phpt | 26 + tests/classes/interfaces_002.phpt | 29 + tests/classes/interfaces_003.phpt | 26 + tests/classes/iterators_001.phpt | 200 + tests/classes/iterators_002.phpt | 113 + tests/classes/iterators_003.phpt | 115 + tests/classes/iterators_004.phpt | 61 + tests/classes/iterators_005.phpt | 19 + tests/classes/iterators_006.phpt | 87 + tests/classes/iterators_007.phpt | 43 + tests/classes/iterators_008.phpt | 45 + tests/classes/method_call_variation_001.phpt | 37 + .../classes/method_override_optional_arg_001.phpt | 33 + .../classes/method_override_optional_arg_002.phpt | 22 + tests/classes/new_001.phpt | 48 + tests/classes/object_reference_001.phpt | 27 + tests/classes/private_001.phpt | 26 + tests/classes/private_002.phpt | 35 + tests/classes/private_003.phpt | 36 + tests/classes/private_003b.phpt | 37 + tests/classes/private_004.phpt | 32 + tests/classes/private_004b.phpt | 35 + tests/classes/private_005.phpt | 32 + tests/classes/private_005b.phpt | 35 + tests/classes/private_006.phpt | 41 + tests/classes/private_006b.phpt | 41 + tests/classes/private_007.phpt | 30 + tests/classes/private_007b.phpt | 31 + tests/classes/private_members.phpt | 103 + tests/classes/private_redeclare.phpt | 38 + .../property_override_privateStatic_private.phpt | 33 + ...perty_override_privateStatic_privateStatic.phpt | 32 + .../property_override_privateStatic_protected.phpt | 33 + ...rty_override_privateStatic_protectedStatic.phpt | 32 + .../property_override_privateStatic_public.phpt | 33 + ...operty_override_privateStatic_publicStatic.phpt | 32 + .../classes/property_override_private_private.phpt | 34 + .../property_override_private_privateStatic.phpt | 34 + .../property_override_private_protected.phpt | 34 + .../property_override_private_protectedStatic.phpt | 34 + .../classes/property_override_private_public.phpt | 34 + .../property_override_private_publicStatic.phpt | 34 + .../property_override_protectedStatic_private.phpt | 33 + ...rty_override_protectedStatic_privateStatic.phpt | 32 + ...roperty_override_protectedStatic_protected.phpt | 33 + ...y_override_protectedStatic_protectedStatic.phpt | 32 + .../property_override_protectedStatic_public.phpt | 33 + ...erty_override_protectedStatic_publicStatic.phpt | 33 + .../property_override_protected_private.phpt | 33 + .../property_override_protected_privateStatic.phpt | 33 + .../property_override_protected_protected.phpt | 34 + ...roperty_override_protected_protectedStatic.phpt | 33 + .../property_override_protected_public.phpt | 34 + .../property_override_protected_publicStatic.phpt | 33 + .../property_override_publicStatic_private.phpt | 33 + ...operty_override_publicStatic_privateStatic.phpt | 32 + .../property_override_publicStatic_protected.phpt | 33 + ...erty_override_publicStatic_protectedStatic.phpt | 32 + .../property_override_publicStatic_public.phpt | 33 + ...roperty_override_publicStatic_publicStatic.phpt | 32 + .../classes/property_override_public_private.phpt | 34 + .../property_override_public_privateStatic.phpt | 33 + .../property_override_public_protected.phpt | 34 + .../property_override_public_protectedStatic.phpt | 33 + tests/classes/property_override_public_public.phpt | 34 + .../property_override_public_publicStatic.phpt | 33 + tests/classes/property_recreate_private.phpt | 81 + tests/classes/property_recreate_protected.phpt | 53 + tests/classes/protected_001.phpt | 26 + tests/classes/protected_001b.phpt | 27 + tests/classes/protected_002.phpt | 35 + tests/classes/serialize_001.phpt | 79 + tests/classes/singleton_001.phpt | 37 + tests/classes/static_mix_1.phpt | 26 + tests/classes/static_mix_2.phpt | 27 + tests/classes/static_properties_001.phpt | 27 + tests/classes/static_properties_003.phpt | 49 + tests/classes/static_properties_003_error1.phpt | 18 + tests/classes/static_properties_003_error2.phpt | 18 + tests/classes/static_properties_003_error3.phpt | 18 + tests/classes/static_properties_003_error4.phpt | 18 + tests/classes/static_properties_004.phpt | 37 + .../static_properties_undeclared_assign.phpt | 9 + .../static_properties_undeclared_assignInc.phpt | 9 + .../static_properties_undeclared_assignRef.phpt | 10 + .../classes/static_properties_undeclared_inc.phpt | 9 + .../static_properties_undeclared_isset.phpt | 9 + .../classes/static_properties_undeclared_read.phpt | 9 + tests/classes/static_this.phpt | 39 + tests/classes/this.phpt | 54 + tests/classes/tostring_001.phpt | 130 + tests/classes/tostring_002.phpt | 31 + tests/classes/tostring_003.phpt | 33 + tests/classes/tostring_004.phpt | 56 + tests/classes/type_hinting_001.phpt | 38 + tests/classes/type_hinting_002.phpt | 16 + tests/classes/type_hinting_003.phpt | 60 + tests/classes/type_hinting_004.phpt | 109 + tests/classes/type_hinting_005a.phpt | 18 + tests/classes/type_hinting_005b.phpt | 14 + tests/classes/type_hinting_005c.phpt | 14 + tests/classes/type_hinting_005d.phpt | 14 + tests/classes/unset_properties.phpt | 154 + tests/classes/visibility_000a.phpt | 33 + tests/classes/visibility_000b.phpt | 33 + tests/classes/visibility_000c.phpt | 33 + tests/classes/visibility_001a.phpt | 33 + tests/classes/visibility_001b.phpt | 33 + tests/classes/visibility_001c.phpt | 33 + tests/classes/visibility_002a.phpt | 33 + tests/classes/visibility_002b.phpt | 33 + tests/classes/visibility_002c.phpt | 33 + tests/classes/visibility_003a.phpt | 33 + tests/classes/visibility_003b.phpt | 33 + tests/classes/visibility_003c.phpt | 33 + tests/classes/visibility_004a.phpt | 33 + tests/classes/visibility_004b.phpt | 33 + tests/classes/visibility_004c.phpt | 33 + tests/classes/visibility_005.phpt | 59 + tests/func/001.phpt | 6 + tests/func/002.phpt | 21 + tests/func/003.phpt | 291 + tests/func/004.phpt | 65 + tests/func/005.phpt | 19 + tests/func/005a.phpt | 32 + tests/func/006.phpt | 26 + tests/func/007.phpt | 22 + tests/func/008.phpt | 16 + tests/func/009.phpt | 16 + tests/func/010.phpt | 77 + tests/func/ini_alter.phpt | 19 + tests/lang/001.phpt | 6 + tests/lang/002.phpt | 12 + tests/lang/003.phpt | 19 + tests/lang/004.phpt | 13 + tests/lang/005.phpt | 16 + tests/lang/006.phpt | 23 + tests/lang/007.phpt | 27 + tests/lang/008.phpt | 18 + tests/lang/009.phpt | 11 + tests/lang/010.phpt | 13 + tests/lang/011.phpt | 23 + tests/lang/012.phpt | 18 + tests/lang/013.phpt | 10 + tests/lang/014.phpt | 13 + tests/lang/015.inc | 3 + tests/lang/015.phpt | 8 + tests/lang/016.inc | 5 + tests/lang/016.phpt | 9 + tests/lang/017.phpt | 18 + tests/lang/018.phpt | 34 + tests/lang/019.phpt | 38 + tests/lang/020.phpt | 76 + tests/lang/021.phpt | 42 + tests/lang/022.phpt | 63 + tests/lang/023-1.inc | 356 + tests/lang/023-2.inc | 6 + tests/lang/023.phpt | 256 + tests/lang/024.phpt | 11623 +++++++++++++++++++ tests/lang/025.phpt | 531 + tests/lang/026.phpt | 6 + tests/lang/027.phpt | 12 + tests/lang/028.phpt | 1058 ++ tests/lang/030.phpt | 36 + tests/lang/031.phpt | 70 + tests/lang/032.phpt | 36 + tests/lang/033.phpt | 47 + tests/lang/034.phpt | 23 + tests/lang/035.phpt | 38 + tests/lang/036.phpt | 27 + tests/lang/037.phpt | 30 + tests/lang/038.phpt | 41 + tests/lang/039.phpt | 45 + tests/lang/040.phpt | 15 + tests/lang/041.phpt | 20 + tests/lang/042.phpt | 19 + tests/lang/043.phpt | 19 + tests/lang/044.phpt | 21 + tests/lang/045.phpt | 27 + tests/lang/array_shortcut_001.phpt | 13 + tests/lang/array_shortcut_002.phpt | 13 + tests/lang/array_shortcut_003.phpt | 13 + tests/lang/array_shortcut_005.phpt | 20 + tests/lang/bison1.phpt | 9 + tests/lang/bug17115.phpt | 16 + tests/lang/bug18872.phpt | 18 + tests/lang/bug19566.phpt | 10 + tests/lang/bug19943.phpt | 29 + tests/lang/bug20175.phpt | 169 + tests/lang/bug21094.phpt | 17 + tests/lang/bug21600.phpt | 39 + tests/lang/bug21669.phpt | 23 + tests/lang/bug21820.phpt | 13 + tests/lang/bug21849.phpt | 16 + tests/lang/bug21961.phpt | 58 + tests/lang/bug22231.phpt | 42 + tests/lang/bug22510.phpt | 126 + tests/lang/bug22592.phpt | 53 + tests/lang/bug22690.phpt | 12 + tests/lang/bug23279.phpt | 16 + tests/lang/bug23384.phpt | 33 + tests/lang/bug23489.phpt | 23 + tests/lang/bug23524.phpt | 29 + tests/lang/bug23584.phpt | 13 + tests/lang/bug23624.phpt | 12 + tests/lang/bug23922.phpt | 20 + tests/lang/bug24054.phpt | 24 + tests/lang/bug24396.phpt | 19 + tests/lang/bug24403.phpt | 20 + tests/lang/bug24436.phpt | 15 + tests/lang/bug24499.phpt | 24 + tests/lang/bug24573.phpt | 24 + tests/lang/bug24640.phpt | 129 + tests/lang/bug24652.phpt | 31 + tests/lang/bug24658.phpt | 56 + tests/lang/bug24783.phpt | 13 + tests/lang/bug24908.phpt | 18 + tests/lang/bug24926.phpt | 28 + tests/lang/bug24951.phpt | 42 + tests/lang/bug25145.phpt | 20 + tests/lang/bug25547.phpt | 30 + tests/lang/bug25652.phpt | 22 + tests/lang/bug25922.phpt | 23 + tests/lang/bug26182.phpt | 25 + tests/lang/bug26696.phpt | 28 + tests/lang/bug26866.phpt | 25 + tests/lang/bug26869.phpt | 15 + tests/lang/bug27354.phpt | 14 + tests/lang/bug27439.phpt | 76 + tests/lang/bug27443.phpt | 8 + tests/lang/bug27535.phpt | 28 + tests/lang/bug28213.phpt | 10 + tests/lang/bug28800.phpt | 17 + tests/lang/bug29566.phpt | 18 + tests/lang/bug29893.phpt | 11 + tests/lang/bug29944.phpt | 20 + tests/lang/bug30578.phpt | 31 + tests/lang/bug30638.phpt | 26 + tests/lang/bug30726.phpt | 8 + tests/lang/bug30862.phpt | 30 + tests/lang/bug32828.phpt | 21 + tests/lang/bug32924.phpt | 14 + tests/lang/bug35176.phpt | 15 + tests/lang/bug35382.phpt | 9 + tests/lang/bug38579.inc | 3 + tests/lang/bug38579.phpt | 16 + tests/lang/bug43958.phpt | 17 + tests/lang/bug44654.phpt | 8 + tests/lang/bug44827.phpt | 17 + tests/lang/bug45392.phpt | 23 + tests/lang/bug55754.phpt | 14 + tests/lang/bug7515.phpt | 37 + tests/lang/catchable_error_001.phpt | 22 + tests/lang/catchable_error_002.phpt | 37 + tests/lang/comments.phpt | 24 + tests/lang/comments2.phpt | 9 + tests/lang/compare_objects_basic1.phpt | 60 + tests/lang/compare_objects_basic2.phpt | 24 + tests/lang/each_binary_safety.phpt | 13 + tests/lang/empty_variation.phpt | 14 + tests/lang/engine_assignExecutionOrder_001.phpt | 152 + tests/lang/engine_assignExecutionOrder_002.phpt | 135 + tests/lang/engine_assignExecutionOrder_003.phpt | 96 + tests/lang/engine_assignExecutionOrder_004.phpt | 52 + tests/lang/engine_assignExecutionOrder_005.phpt | 74 + tests/lang/engine_assignExecutionOrder_006.phpt | 138 + tests/lang/engine_assignExecutionOrder_007.phpt | 46 + tests/lang/engine_assignExecutionOrder_008.phpt | 81 + tests/lang/engine_assignExecutionOrder_009.phpt | 36 + tests/lang/error_2_exception_001.phpt | 45 + tests/lang/execution_order.phpt | 198 + tests/lang/foreachLoop.001.phpt | 64 + tests/lang/foreachLoop.002.phpt | 173 + tests/lang/foreachLoop.003.phpt | 46 + tests/lang/foreachLoop.004.phpt | 76 + tests/lang/foreachLoop.005.phpt | 23 + tests/lang/foreachLoop.006.phpt | 11 + tests/lang/foreachLoop.007.phpt | 11 + tests/lang/foreachLoop.008.phpt | 10 + tests/lang/foreachLoop.009.phpt | 82 + tests/lang/foreachLoop.010.phpt | 40 + tests/lang/foreachLoop.011.phpt | 34 + tests/lang/foreachLoop.012.phpt | 494 + tests/lang/foreachLoop.013.phpt | 555 + tests/lang/foreachLoop.014.phpt | 556 + tests/lang/foreachLoop.015.phpt | 557 + tests/lang/foreachLoop.016.phpt | 206 + tests/lang/foreachLoop.017.phpt | 11 + tests/lang/foreachLoopIterator.001.phpt | 134 + tests/lang/foreachLoopIterator.002.phpt | 24 + tests/lang/foreachLoopIteratorAggregate.001.phpt | 270 + tests/lang/foreachLoopIteratorAggregate.002.phpt | 53 + tests/lang/foreachLoopIteratorAggregate.003.phpt | 133 + tests/lang/foreachLoopIteratorAggregate.004.phpt | 104 + tests/lang/foreachLoopObjects.001.phpt | 69 + tests/lang/foreachLoopObjects.002.phpt | 587 + tests/lang/foreachLoopObjects.003.phpt | 250 + tests/lang/foreachLoopObjects.004.phpt | 55 + tests/lang/foreachLoopObjects.005.phpt | 78 + tests/lang/foreachLoopObjects.006.phpt | 147 + tests/lang/foreach_with_object_001.phpt | 25 + tests/lang/foreach_with_references_001.phpt | 32 + tests/lang/func_get_arg.001.phpt | 15 + tests/lang/func_get_arg.002.phpt | 19 + tests/lang/func_get_arg.003.phpt | 11 + tests/lang/func_get_arg.004.phpt | 16 + tests/lang/func_get_arg.005.phpt | 19 + tests/lang/func_get_arg_variation.phpt | 28 + tests/lang/func_get_args.001.phpt | 15 + tests/lang/func_get_args.002.phpt | 22 + tests/lang/func_get_args.003.phpt | 11 + tests/lang/func_get_args.004.phpt | 67 + tests/lang/func_num_args.001.phpt | 14 + tests/lang/func_num_args.002.phpt | 14 + tests/lang/func_num_args.003.phpt | 12 + tests/lang/func_num_args.004.phpt | 48 + tests/lang/inc.inc | 3 + tests/lang/inc_throw.inc | 5 + tests/lang/include_files/echo.inc | 3 + tests/lang/include_files/eval.inc | 3 + tests/lang/include_files/function.inc | 3 + tests/lang/include_variation1.phpt | 8 + tests/lang/include_variation2.phpt | 9 + tests/lang/include_variation3.phpt | 8 + tests/lang/operators/add_basiclong_64bit.phpt | 582 + tests/lang/operators/add_variationStr.phpt | 416 + .../lang/operators/bitwiseAnd_basiclong_64bit.phpt | 582 + tests/lang/operators/bitwiseAnd_variationStr.phpt | 416 + .../lang/operators/bitwiseNot_basiclong_64bit.phpt | 60 + tests/lang/operators/bitwiseNot_variationStr.phpt | 48 + .../lang/operators/bitwiseOr_basiclong_64bit.phpt | 583 + tests/lang/operators/bitwiseOr_variationStr.phpt | 416 + .../bitwiseShiftLeft_basiclong_64bit.phpt | 583 + .../operators/bitwiseShiftLeft_variationStr.phpt | 421 + .../bitwiseShiftLeft_variationStr_64bit.phpt | 420 + .../bitwiseShiftRight_basiclong_64bit.phpt | 583 + .../operators/bitwiseShiftRight_variationStr.phpt | 416 + .../lang/operators/bitwiseXor_basiclong_64bit.phpt | 583 + tests/lang/operators/bitwiseXor_variationStr.phpt | 416 + tests/lang/operators/divide_basiclong_64bit.phpt | 582 + tests/lang/operators/divide_variationStr.phpt | 416 + tests/lang/operators/modulus_basiclong_64bit.phpt | 582 + tests/lang/operators/modulus_variationStr.phpt | 416 + tests/lang/operators/multiply_basiclong_64bit.phpt | 582 + tests/lang/operators/multiply_variationStr.phpt | 416 + tests/lang/operators/negate_basiclong_64bit.phpt | 60 + tests/lang/operators/negate_variationStr.phpt | 48 + tests/lang/operators/operator_equals_basic.phpt | 65 + .../lang/operators/operator_equals_variation.phpt | 63 + .../operators/operator_equals_variation_64bit.phpt | 65 + tests/lang/operators/operator_gt_basic.phpt | 65 + .../lang/operators/operator_gt_or_equal_basic.phpt | 65 + .../operators/operator_gt_or_equal_variation.phpt | 63 + .../operator_gt_or_equal_variation_64bit.phpt | 63 + tests/lang/operators/operator_gt_variation.phpt | 62 + .../operators/operator_gt_variation_64bit.phpt | 62 + tests/lang/operators/operator_identical_basic.phpt | 65 + .../operators/operator_identical_variation.phpt | 63 + .../operator_identical_variation_64bit.phpt | 65 + tests/lang/operators/operator_lt_basic.phpt | 62 + .../lang/operators/operator_lt_or_equal_basic.phpt | 64 + .../operators/operator_lt_or_equal_variation.phpt | 63 + .../operator_lt_or_equal_variation_64bit.phpt | 63 + tests/lang/operators/operator_lt_variation.phpt | 60 + .../operators/operator_lt_variation_64bit.phpt | 60 + tests/lang/operators/operator_notequals_basic.phpt | 65 + .../operators/operator_notequals_variation.phpt | 63 + .../operator_notequals_variation_64bit.phpt | 65 + .../operators/operator_notidentical_basic.phpt | 65 + .../operators/operator_notidentical_variation.phpt | 64 + .../operator_notidentical_variation_64bit.phpt | 65 + tests/lang/operators/postdec_basiclong_64bit.phpt | 61 + tests/lang/operators/postdec_variationStr.phpt | 49 + tests/lang/operators/postinc_basiclong_64bit.phpt | 61 + tests/lang/operators/postinc_variationStr.phpt | 49 + tests/lang/operators/predec_basiclong_64bit.phpt | 60 + tests/lang/operators/predec_variationStr.phpt | 48 + tests/lang/operators/preinc_basiclong_64bit.phpt | 60 + tests/lang/operators/preinc_variationStr.phpt | 48 + tests/lang/operators/subtract_basiclong_64bit.phpt | 582 + tests/lang/operators/subtract_variationStr.phpt | 416 + tests/lang/passByReference_001.phpt | 37 + tests/lang/passByReference_002.phpt | 15 + tests/lang/passByReference_003.phpt | 48 + tests/lang/passByReference_004.phpt | 21 + tests/lang/passByReference_005.phpt | 261 + tests/lang/passByReference_006.phpt | 195 + tests/lang/passByReference_007.phpt | 105 + tests/lang/passByReference_008.phpt | 40 + tests/lang/passByReference_009.phpt | 24 + tests/lang/passByReference_010.phpt | 61 + tests/lang/passByReference_012.phpt | 25 + tests/lang/returnByReference.001.phpt | 20 + tests/lang/returnByReference.002.phpt | 29 + tests/lang/returnByReference.003.phpt | 55 + tests/lang/returnByReference.004.phpt | 57 + tests/lang/returnByReference.005.phpt | 58 + tests/lang/returnByReference.006.phpt | 60 + tests/lang/returnByReference.007.phpt | 63 + tests/lang/returnByReference.008.phpt | 64 + tests/lang/returnByReference.009.phpt | 39 + tests/lang/script_tag.phpt | 17 + tests/lang/short_tags.001.phpt | 12 + tests/lang/short_tags.002.phpt | 14 + tests/lang/short_tags.003.phpt | 32 + tests/lang/short_tags.004.phpt | 35 + tests/lang/static_basic_001.phpt | 84 + tests/lang/static_basic_002.phpt | 28 + tests/lang/static_variation_001.phpt | 112 + tests/lang/static_variation_002.phpt | 84 + tests/lang/string_decimals_001.phpt | 45 + tests/lang/this_assignment.phpt | 43 + tests/lang/throw_variation_001.phpt | 14 + tests/lang/type_hints_001.phpt | 26 + tests/lang/type_hints_002.phpt | 28 + tests/lang/type_hints_003.phpt | 14 + tests/output/bug46897.phpt | 27 + tests/output/bug60282.phpt | 12 + tests/output/bug60321.phpt | 9 + tests/output/bug60322.phpt | 8 + tests/output/bug60768.phpt | 25 + tests/output/flush_basic_001.phpt | 26 + tests/output/flush_error_001.phpt | 16 + tests/output/ob_001.phpt | 8 + tests/output/ob_002.phpt | 9 + tests/output/ob_003.phpt | 13 + tests/output/ob_004.phpt | 11 + tests/output/ob_005.phpt | 14 + tests/output/ob_006.phpt | 12 + tests/output/ob_007.phpt | 11 + tests/output/ob_008.phpt | 11 + tests/output/ob_009.phpt | 12 + tests/output/ob_010.phpt | 13 + tests/output/ob_011.phpt | 13 + tests/output/ob_012.phpt | 22 + tests/output/ob_013.phpt | 105 + tests/output/ob_014.phpt | 22 + tests/output/ob_015.phpt | 22 + tests/output/ob_017.phpt | 34 + tests/output/ob_018.phpt | 17 + tests/output/ob_020.phpt | 38 + tests/output/ob_clean_basic_001.phpt | 36 + tests/output/ob_clean_error_001.phpt | 27 + tests/output/ob_end_clean_basic_001.phpt | 31 + tests/output/ob_end_clean_error_001.phpt | 22 + tests/output/ob_end_flush_basic_001.phpt | 41 + tests/output/ob_end_flush_error_001.phpt | 27 + tests/output/ob_flush_basic_001.phpt | 39 + tests/output/ob_flush_error_001.phpt | 27 + tests/output/ob_get_clean_basic_001.phpt | 18 + tests/output/ob_get_clean_basic_002.phpt | 20 + tests/output/ob_get_clean_error_001.phpt | 22 + tests/output/ob_get_contents_basic_001.phpt | 73 + tests/output/ob_get_contents_error_001.phpt | 32 + tests/output/ob_get_length_basic_001.phpt | 37 + tests/output/ob_get_length_error_001.phpt | 22 + tests/output/ob_get_level_basic_001.phpt | 47 + tests/output/ob_get_level_error_001.phpt | 27 + tests/output/ob_get_status.phpt | 33 + tests/output/ob_implicit_flush_basic_001.phpt | 24 + tests/output/ob_implicit_flush_basic_002.phpt | 29 + tests/output/ob_implicit_flush_error_001.phpt | 29 + tests/output/ob_implicit_flush_variation_001.phpt | 192 + tests/output/ob_start_basic_001.phpt | 14 + tests/output/ob_start_basic_002.phpt | 55 + tests/output/ob_start_basic_003.phpt | 18 + tests/output/ob_start_basic_004.phpt | 132 + tests/output/ob_start_basic_005.phpt | 33 + tests/output/ob_start_basic_006.phpt | 135 + tests/output/ob_start_basic_unerasable_001.phpt | 22 + tests/output/ob_start_basic_unerasable_002.phpt | 33 + tests/output/ob_start_basic_unerasable_003.phpt | 22 + tests/output/ob_start_basic_unerasable_004.phpt | 22 + tests/output/ob_start_basic_unerasable_005.phpt | 25 + tests/output/ob_start_callbacks.phpt | 39 + tests/output/ob_start_error_001.phpt | 53 + tests/output/ob_start_error_002.phpt | 42 + tests/output/ob_start_error_003.phpt | 22 + tests/output/ob_start_error_004.phpt | 22 + tests/output/ob_start_error_005.phpt | 23 + tests/quicktester.inc | 75 + tests/run-test/test001.phpt | 6 + tests/run-test/test002.phpt | 18 + tests/run-test/test003.phpt | 6 + tests/run-test/test004.phpt | 10 + tests/run-test/test005.phpt | 32 + tests/run-test/test006.phpt | 9 + tests/run-test/test007.phpt | Bin 0 -> 1191 bytes tests/run-test/test008.phpt | 33 + tests/run-test/test008a.phpt | 32 + tests/run-test/test009.phpt | 12 + tests/run-test/test010.phpt | 17 + tests/security/bug53226.phpt | 29 + tests/security/open_basedir.inc | 139 + tests/security/open_basedir_001.phpt | 25 + tests/security/open_basedir_chdir.phpt | 50 + tests/security/open_basedir_chmod.phpt | 72 + tests/security/open_basedir_copy.phpt | 78 + tests/security/open_basedir_copy_variation1.phpt | 34 + tests/security/open_basedir_dir.phpt | 89 + tests/security/open_basedir_disk_free_space.phpt | 52 + tests/security/open_basedir_error_log.phpt | 45 + .../security/open_basedir_error_log_variation.phpt | 49 + tests/security/open_basedir_file.phpt | 88 + tests/security/open_basedir_file_exists.phpt | 55 + tests/security/open_basedir_file_get_contents.phpt | 75 + tests/security/open_basedir_file_put_contents.phpt | 57 + tests/security/open_basedir_fileatime.phpt | 55 + tests/security/open_basedir_filectime.phpt | 55 + tests/security/open_basedir_filegroup.phpt | 55 + tests/security/open_basedir_fileinode.phpt | 55 + tests/security/open_basedir_filemtime.phpt | 55 + tests/security/open_basedir_fileowner.phpt | 55 + tests/security/open_basedir_fileperms.phpt | 55 + tests/security/open_basedir_filesize.phpt | 55 + tests/security/open_basedir_filetype.phpt | 55 + tests/security/open_basedir_fopen.phpt | 86 + tests/security/open_basedir_glob.phpt | 52 + tests/security/open_basedir_glob_variation.phpt | 26 + tests/security/open_basedir_is_dir.phpt | 55 + tests/security/open_basedir_is_executable.phpt | 59 + tests/security/open_basedir_is_file.phpt | 55 + tests/security/open_basedir_is_link.phpt | 55 + tests/security/open_basedir_is_readable.phpt | 55 + tests/security/open_basedir_is_writable.phpt | 55 + tests/security/open_basedir_link.phpt | 78 + tests/security/open_basedir_linkinfo.phpt | 65 + tests/security/open_basedir_lstat.phpt | 55 + tests/security/open_basedir_mkdir.phpt | 52 + tests/security/open_basedir_opendir.phpt | 73 + tests/security/open_basedir_parse_ini_file.phpt | 75 + tests/security/open_basedir_readlink.phpt | 72 + tests/security/open_basedir_realpath.phpt | 61 + tests/security/open_basedir_rename.phpt | 47 + tests/security/open_basedir_rmdir.phpt | 47 + tests/security/open_basedir_scandir.phpt | 110 + tests/security/open_basedir_stat.phpt | 55 + tests/security/open_basedir_symlink.phpt | 87 + tests/security/open_basedir_tempnam.phpt | 75 + tests/security/open_basedir_touch.phpt | 70 + tests/security/open_basedir_unlink.phpt | 47 + tests/strings/001.phpt | 210 + tests/strings/002.phpt | 83 + tests/strings/004.phpt | 21 + tests/strings/bug22592.phpt | 27 + tests/strings/bug26703.phpt | 17 + tests/strings/offsets_chaining_1.phpt | 12 + tests/strings/offsets_chaining_2.phpt | 12 + tests/strings/offsets_chaining_3.phpt | 12 + tests/strings/offsets_chaining_4.phpt | 12 + tests/strings/offsets_chaining_5.phpt | 27 + tests/strings/offsets_general.phpt | 38 + 779 files changed, 57019 insertions(+) create mode 100644 tests/basic/001.phpt create mode 100644 tests/basic/002.phpt create mode 100644 tests/basic/003.phpt create mode 100644 tests/basic/004.phpt create mode 100644 tests/basic/005.phpt create mode 100644 tests/basic/006.phpt create mode 100644 tests/basic/007.phpt create mode 100644 tests/basic/008.phpt create mode 100644 tests/basic/009.phpt create mode 100644 tests/basic/010.phpt create mode 100644 tests/basic/011.phpt create mode 100644 tests/basic/012.phpt create mode 100644 tests/basic/013.phpt create mode 100644 tests/basic/014.phpt create mode 100644 tests/basic/015.phpt create mode 100644 tests/basic/016.phpt create mode 100644 tests/basic/017.phpt create mode 100644 tests/basic/018.phpt create mode 100644 tests/basic/019.phpt create mode 100644 tests/basic/020.phpt create mode 100644 tests/basic/021.phpt create mode 100644 tests/basic/022.phpt create mode 100644 tests/basic/023.phpt create mode 100644 tests/basic/024.phpt create mode 100644 tests/basic/025.phpt create mode 100644 tests/basic/026.phpt create mode 100644 tests/basic/027.phpt create mode 100644 tests/basic/028.phpt create mode 100644 tests/basic/029.phpt create mode 100644 tests/basic/030.phpt create mode 100644 tests/basic/031.phpt create mode 100644 tests/basic/032.phpt create mode 100644 tests/basic/bug20539.phpt create mode 100644 tests/basic/bug29971.phpt create mode 100644 tests/basic/bug45986.phpt create mode 100644 tests/basic/bug51709_1.phpt create mode 100644 tests/basic/bug51709_2.phpt create mode 100644 tests/basic/bug53180.phpt create mode 100644 tests/basic/bug54514.phpt create mode 100644 tests/basic/bug55500.phpt create mode 100644 tests/basic/bug61000.phpt create mode 100644 tests/basic/enable_post_data_reading_01.phpt create mode 100644 tests/basic/enable_post_data_reading_02.phpt create mode 100644 tests/basic/enable_post_data_reading_03.phpt create mode 100644 tests/basic/enable_post_data_reading_04.phpt create mode 100644 tests/basic/php_egg_logo_guid.phpt create mode 100644 tests/basic/php_logo_guid.phpt create mode 100644 tests/basic/php_real_logo_guid.phpt create mode 100644 tests/basic/req44164.phpt create mode 100644 tests/basic/rfc1867_anonymous_upload.phpt create mode 100644 tests/basic/rfc1867_array_upload.phpt create mode 100644 tests/basic/rfc1867_boundary_1.phpt create mode 100644 tests/basic/rfc1867_boundary_2.phpt create mode 100644 tests/basic/rfc1867_empty_upload.phpt create mode 100644 tests/basic/rfc1867_file_upload_disabled.phpt create mode 100644 tests/basic/rfc1867_garbled_mime_headers.phpt create mode 100644 tests/basic/rfc1867_invalid_boundary.phpt create mode 100644 tests/basic/rfc1867_malicious_input.phpt create mode 100644 tests/basic/rfc1867_max_file_size.phpt create mode 100644 tests/basic/rfc1867_max_file_uploads_empty_files.phpt create mode 100644 tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt create mode 100644 tests/basic/rfc1867_missing_boundary.phpt create mode 100644 tests/basic/rfc1867_missing_boundary_2.phpt create mode 100644 tests/basic/rfc1867_post_max_filesize.phpt create mode 100644 tests/basic/rfc1867_post_max_size.phpt create mode 100644 tests/basic/zend_logo_guid.phpt create mode 100644 tests/classes/__call_001.phpt create mode 100644 tests/classes/__call_002.phpt create mode 100644 tests/classes/__call_003.phpt create mode 100644 tests/classes/__call_004.phpt create mode 100644 tests/classes/__call_005.phpt create mode 100644 tests/classes/__call_006.phpt create mode 100644 tests/classes/__call_007.phpt create mode 100644 tests/classes/__set__get_001.phpt create mode 100644 tests/classes/__set__get_002.phpt create mode 100644 tests/classes/__set__get_003.phpt create mode 100644 tests/classes/__set__get_004.phpt create mode 100644 tests/classes/__set__get_005.phpt create mode 100644 tests/classes/__set_data_corrupt.phpt create mode 100644 tests/classes/abstract.phpt create mode 100644 tests/classes/abstract_by_interface_001.phpt create mode 100644 tests/classes/abstract_by_interface_002.phpt create mode 100644 tests/classes/abstract_class.phpt create mode 100644 tests/classes/abstract_derived.phpt create mode 100644 tests/classes/abstract_final.phpt create mode 100644 tests/classes/abstract_inherit.phpt create mode 100644 tests/classes/abstract_not_declared.phpt create mode 100644 tests/classes/abstract_redeclare.phpt create mode 100644 tests/classes/abstract_static.phpt create mode 100644 tests/classes/abstract_user_call.phpt create mode 100644 tests/classes/array_access_001.phpt create mode 100644 tests/classes/array_access_002.phpt create mode 100644 tests/classes/array_access_003.phpt create mode 100644 tests/classes/array_access_004.phpt create mode 100644 tests/classes/array_access_005.phpt create mode 100644 tests/classes/array_access_006.phpt create mode 100644 tests/classes/array_access_007.phpt create mode 100644 tests/classes/array_access_008.phpt create mode 100644 tests/classes/array_access_009.phpt create mode 100644 tests/classes/array_access_010.phpt create mode 100644 tests/classes/array_access_011.phpt create mode 100644 tests/classes/array_access_012.phpt create mode 100644 tests/classes/array_access_013.phpt create mode 100644 tests/classes/arrayobject_001.phpt create mode 100644 tests/classes/assign_op_property_001.phpt create mode 100644 tests/classes/autoload_001.phpt create mode 100644 tests/classes/autoload_002.phpt create mode 100644 tests/classes/autoload_003.phpt create mode 100644 tests/classes/autoload_004.phpt create mode 100644 tests/classes/autoload_005.phpt create mode 100644 tests/classes/autoload_006.phpt create mode 100644 tests/classes/autoload_007.phpt create mode 100644 tests/classes/autoload_008.phpt create mode 100644 tests/classes/autoload_009.phpt create mode 100644 tests/classes/autoload_010.phpt create mode 100644 tests/classes/autoload_011.phpt create mode 100644 tests/classes/autoload_012.phpt create mode 100644 tests/classes/autoload_013.phpt create mode 100644 tests/classes/autoload_014.phpt create mode 100644 tests/classes/autoload_015.phpt create mode 100644 tests/classes/autoload_016.phpt create mode 100644 tests/classes/autoload_017.phpt create mode 100644 tests/classes/autoload_018.phpt create mode 100644 tests/classes/autoload_019.phpt create mode 100644 tests/classes/autoload_020.phpt create mode 100755 tests/classes/autoload_derived.p5c create mode 100755 tests/classes/autoload_implements.p5c create mode 100755 tests/classes/autoload_interface.p5c create mode 100755 tests/classes/autoload_root.p5c create mode 100644 tests/classes/bug23951.phpt create mode 100644 tests/classes/bug24399.phpt create mode 100644 tests/classes/bug24445.phpt create mode 100644 tests/classes/bug26737.phpt create mode 100644 tests/classes/bug27468.phpt create mode 100644 tests/classes/bug27504.phpt create mode 100644 tests/classes/bug29446.phpt create mode 100644 tests/classes/bug63462.phpt create mode 100644 tests/classes/class_abstract.phpt create mode 100644 tests/classes/class_example.phpt create mode 100644 tests/classes/class_final.phpt create mode 100644 tests/classes/class_stdclass.phpt create mode 100644 tests/classes/clone_001.phpt create mode 100644 tests/classes/clone_002.phpt create mode 100644 tests/classes/clone_003.phpt create mode 100644 tests/classes/clone_004.phpt create mode 100644 tests/classes/clone_005.phpt create mode 100644 tests/classes/clone_006.phpt create mode 100644 tests/classes/constants_basic_001.phpt create mode 100644 tests/classes/constants_basic_002.phpt create mode 100644 tests/classes/constants_basic_003.inc create mode 100644 tests/classes/constants_basic_003.phpt create mode 100644 tests/classes/constants_basic_004.phpt create mode 100644 tests/classes/constants_basic_005.phpt create mode 100644 tests/classes/constants_basic_006.phpt create mode 100644 tests/classes/constants_error_001.phpt create mode 100644 tests/classes/constants_error_002.phpt create mode 100644 tests/classes/constants_error_003.phpt create mode 100644 tests/classes/constants_error_004.phpt create mode 100644 tests/classes/constants_error_005.phpt create mode 100644 tests/classes/constants_error_006.phpt create mode 100644 tests/classes/constants_error_007.phpt create mode 100644 tests/classes/constants_scope_001.phpt create mode 100644 tests/classes/ctor_dtor.phpt create mode 100644 tests/classes/ctor_dtor_inheritance.phpt create mode 100644 tests/classes/ctor_failure.phpt create mode 100644 tests/classes/ctor_in_interface_01.phpt create mode 100644 tests/classes/ctor_in_interface_02.phpt create mode 100644 tests/classes/ctor_in_interface_03.phpt create mode 100644 tests/classes/ctor_in_interface_04.phpt create mode 100644 tests/classes/ctor_name_clash.phpt create mode 100644 tests/classes/ctor_visibility.phpt create mode 100644 tests/classes/dereferencing_001.phpt create mode 100644 tests/classes/destructor_and_echo.phpt create mode 100644 tests/classes/destructor_and_exceptions.phpt create mode 100644 tests/classes/destructor_and_globals.phpt create mode 100644 tests/classes/destructor_and_references.phpt create mode 100644 tests/classes/destructor_inheritance.phpt create mode 100644 tests/classes/destructor_visibility_001.phpt create mode 100644 tests/classes/destructor_visibility_002.phpt create mode 100644 tests/classes/destructor_visibility_003.phpt create mode 100644 tests/classes/factory_001.phpt create mode 100644 tests/classes/factory_and_singleton_001.phpt create mode 100644 tests/classes/factory_and_singleton_002.phpt create mode 100644 tests/classes/factory_and_singleton_003.phpt create mode 100644 tests/classes/factory_and_singleton_004.phpt create mode 100644 tests/classes/factory_and_singleton_005.phpt create mode 100644 tests/classes/factory_and_singleton_006.phpt create mode 100644 tests/classes/factory_and_singleton_007.phpt create mode 100644 tests/classes/factory_and_singleton_008.phpt create mode 100644 tests/classes/factory_and_singleton_009.phpt create mode 100644 tests/classes/factory_and_singleton_010.phpt create mode 100644 tests/classes/final.phpt create mode 100644 tests/classes/final_abstract.phpt create mode 100644 tests/classes/final_ctor1.phpt create mode 100644 tests/classes/final_ctor2.phpt create mode 100644 tests/classes/final_ctor3.phpt create mode 100644 tests/classes/final_redeclare.phpt create mode 100644 tests/classes/implicit_instantiation_001.phpt create mode 100644 tests/classes/incdec_property_001.phpt create mode 100644 tests/classes/incdec_property_002.phpt create mode 100644 tests/classes/incdec_property_003.phpt create mode 100644 tests/classes/incdec_property_004.phpt create mode 100644 tests/classes/inheritance.phpt create mode 100644 tests/classes/inheritance_002.phpt create mode 100644 tests/classes/inheritance_003.phpt create mode 100644 tests/classes/inheritance_004.phpt create mode 100644 tests/classes/inheritance_005.phpt create mode 100644 tests/classes/inheritance_006.phpt create mode 100644 tests/classes/inheritance_007.phpt create mode 100644 tests/classes/interface_and_extends.phpt create mode 100644 tests/classes/interface_class.phpt create mode 100644 tests/classes/interface_constant_inheritance_001.phpt create mode 100644 tests/classes/interface_constant_inheritance_002.phpt create mode 100644 tests/classes/interface_constant_inheritance_003.phpt create mode 100644 tests/classes/interface_constant_inheritance_004.phpt create mode 100644 tests/classes/interface_doubled.phpt create mode 100644 tests/classes/interface_implemented.phpt create mode 100644 tests/classes/interface_instantiate.phpt create mode 100644 tests/classes/interface_member.phpt create mode 100644 tests/classes/interface_method.phpt create mode 100644 tests/classes/interface_method_final.phpt create mode 100644 tests/classes/interface_method_private.phpt create mode 100644 tests/classes/interface_must_be_implemented.phpt create mode 100644 tests/classes/interface_optional_arg.phpt create mode 100644 tests/classes/interface_optional_arg_002.phpt create mode 100644 tests/classes/interface_optional_arg_003.inc create mode 100644 tests/classes/interface_optional_arg_003.phpt create mode 100644 tests/classes/interfaces_001.phpt create mode 100644 tests/classes/interfaces_002.phpt create mode 100644 tests/classes/interfaces_003.phpt create mode 100644 tests/classes/iterators_001.phpt create mode 100644 tests/classes/iterators_002.phpt create mode 100644 tests/classes/iterators_003.phpt create mode 100644 tests/classes/iterators_004.phpt create mode 100644 tests/classes/iterators_005.phpt create mode 100644 tests/classes/iterators_006.phpt create mode 100644 tests/classes/iterators_007.phpt create mode 100644 tests/classes/iterators_008.phpt create mode 100644 tests/classes/method_call_variation_001.phpt create mode 100644 tests/classes/method_override_optional_arg_001.phpt create mode 100644 tests/classes/method_override_optional_arg_002.phpt create mode 100644 tests/classes/new_001.phpt create mode 100644 tests/classes/object_reference_001.phpt create mode 100644 tests/classes/private_001.phpt create mode 100644 tests/classes/private_002.phpt create mode 100644 tests/classes/private_003.phpt create mode 100644 tests/classes/private_003b.phpt create mode 100644 tests/classes/private_004.phpt create mode 100644 tests/classes/private_004b.phpt create mode 100644 tests/classes/private_005.phpt create mode 100644 tests/classes/private_005b.phpt create mode 100644 tests/classes/private_006.phpt create mode 100644 tests/classes/private_006b.phpt create mode 100644 tests/classes/private_007.phpt create mode 100644 tests/classes/private_007b.phpt create mode 100644 tests/classes/private_members.phpt create mode 100644 tests/classes/private_redeclare.phpt create mode 100644 tests/classes/property_override_privateStatic_private.phpt create mode 100644 tests/classes/property_override_privateStatic_privateStatic.phpt create mode 100644 tests/classes/property_override_privateStatic_protected.phpt create mode 100644 tests/classes/property_override_privateStatic_protectedStatic.phpt create mode 100644 tests/classes/property_override_privateStatic_public.phpt create mode 100644 tests/classes/property_override_privateStatic_publicStatic.phpt create mode 100644 tests/classes/property_override_private_private.phpt create mode 100644 tests/classes/property_override_private_privateStatic.phpt create mode 100644 tests/classes/property_override_private_protected.phpt create mode 100644 tests/classes/property_override_private_protectedStatic.phpt create mode 100644 tests/classes/property_override_private_public.phpt create mode 100644 tests/classes/property_override_private_publicStatic.phpt create mode 100644 tests/classes/property_override_protectedStatic_private.phpt create mode 100644 tests/classes/property_override_protectedStatic_privateStatic.phpt create mode 100644 tests/classes/property_override_protectedStatic_protected.phpt create mode 100644 tests/classes/property_override_protectedStatic_protectedStatic.phpt create mode 100644 tests/classes/property_override_protectedStatic_public.phpt create mode 100644 tests/classes/property_override_protectedStatic_publicStatic.phpt create mode 100644 tests/classes/property_override_protected_private.phpt create mode 100644 tests/classes/property_override_protected_privateStatic.phpt create mode 100644 tests/classes/property_override_protected_protected.phpt create mode 100644 tests/classes/property_override_protected_protectedStatic.phpt create mode 100644 tests/classes/property_override_protected_public.phpt create mode 100644 tests/classes/property_override_protected_publicStatic.phpt create mode 100644 tests/classes/property_override_publicStatic_private.phpt create mode 100644 tests/classes/property_override_publicStatic_privateStatic.phpt create mode 100644 tests/classes/property_override_publicStatic_protected.phpt create mode 100644 tests/classes/property_override_publicStatic_protectedStatic.phpt create mode 100644 tests/classes/property_override_publicStatic_public.phpt create mode 100644 tests/classes/property_override_publicStatic_publicStatic.phpt create mode 100644 tests/classes/property_override_public_private.phpt create mode 100644 tests/classes/property_override_public_privateStatic.phpt create mode 100644 tests/classes/property_override_public_protected.phpt create mode 100644 tests/classes/property_override_public_protectedStatic.phpt create mode 100644 tests/classes/property_override_public_public.phpt create mode 100644 tests/classes/property_override_public_publicStatic.phpt create mode 100644 tests/classes/property_recreate_private.phpt create mode 100644 tests/classes/property_recreate_protected.phpt create mode 100644 tests/classes/protected_001.phpt create mode 100644 tests/classes/protected_001b.phpt create mode 100644 tests/classes/protected_002.phpt create mode 100644 tests/classes/serialize_001.phpt create mode 100644 tests/classes/singleton_001.phpt create mode 100644 tests/classes/static_mix_1.phpt create mode 100644 tests/classes/static_mix_2.phpt create mode 100644 tests/classes/static_properties_001.phpt create mode 100644 tests/classes/static_properties_003.phpt create mode 100644 tests/classes/static_properties_003_error1.phpt create mode 100644 tests/classes/static_properties_003_error2.phpt create mode 100644 tests/classes/static_properties_003_error3.phpt create mode 100644 tests/classes/static_properties_003_error4.phpt create mode 100644 tests/classes/static_properties_004.phpt create mode 100644 tests/classes/static_properties_undeclared_assign.phpt create mode 100644 tests/classes/static_properties_undeclared_assignInc.phpt create mode 100644 tests/classes/static_properties_undeclared_assignRef.phpt create mode 100644 tests/classes/static_properties_undeclared_inc.phpt create mode 100644 tests/classes/static_properties_undeclared_isset.phpt create mode 100644 tests/classes/static_properties_undeclared_read.phpt create mode 100644 tests/classes/static_this.phpt create mode 100644 tests/classes/this.phpt create mode 100644 tests/classes/tostring_001.phpt create mode 100644 tests/classes/tostring_002.phpt create mode 100644 tests/classes/tostring_003.phpt create mode 100644 tests/classes/tostring_004.phpt create mode 100644 tests/classes/type_hinting_001.phpt create mode 100644 tests/classes/type_hinting_002.phpt create mode 100644 tests/classes/type_hinting_003.phpt create mode 100644 tests/classes/type_hinting_004.phpt create mode 100644 tests/classes/type_hinting_005a.phpt create mode 100644 tests/classes/type_hinting_005b.phpt create mode 100644 tests/classes/type_hinting_005c.phpt create mode 100644 tests/classes/type_hinting_005d.phpt create mode 100644 tests/classes/unset_properties.phpt create mode 100644 tests/classes/visibility_000a.phpt create mode 100644 tests/classes/visibility_000b.phpt create mode 100644 tests/classes/visibility_000c.phpt create mode 100644 tests/classes/visibility_001a.phpt create mode 100644 tests/classes/visibility_001b.phpt create mode 100644 tests/classes/visibility_001c.phpt create mode 100644 tests/classes/visibility_002a.phpt create mode 100644 tests/classes/visibility_002b.phpt create mode 100644 tests/classes/visibility_002c.phpt create mode 100644 tests/classes/visibility_003a.phpt create mode 100644 tests/classes/visibility_003b.phpt create mode 100644 tests/classes/visibility_003c.phpt create mode 100644 tests/classes/visibility_004a.phpt create mode 100644 tests/classes/visibility_004b.phpt create mode 100644 tests/classes/visibility_004c.phpt create mode 100644 tests/classes/visibility_005.phpt create mode 100644 tests/func/001.phpt create mode 100644 tests/func/002.phpt create mode 100644 tests/func/003.phpt create mode 100644 tests/func/004.phpt create mode 100644 tests/func/005.phpt create mode 100644 tests/func/005a.phpt create mode 100644 tests/func/006.phpt create mode 100644 tests/func/007.phpt create mode 100644 tests/func/008.phpt create mode 100644 tests/func/009.phpt create mode 100644 tests/func/010.phpt create mode 100644 tests/func/ini_alter.phpt create mode 100644 tests/lang/001.phpt create mode 100644 tests/lang/002.phpt create mode 100644 tests/lang/003.phpt create mode 100644 tests/lang/004.phpt create mode 100644 tests/lang/005.phpt create mode 100644 tests/lang/006.phpt create mode 100644 tests/lang/007.phpt create mode 100644 tests/lang/008.phpt create mode 100644 tests/lang/009.phpt create mode 100644 tests/lang/010.phpt create mode 100644 tests/lang/011.phpt create mode 100644 tests/lang/012.phpt create mode 100644 tests/lang/013.phpt create mode 100644 tests/lang/014.phpt create mode 100644 tests/lang/015.inc create mode 100644 tests/lang/015.phpt create mode 100644 tests/lang/016.inc create mode 100644 tests/lang/016.phpt create mode 100644 tests/lang/017.phpt create mode 100644 tests/lang/018.phpt create mode 100644 tests/lang/019.phpt create mode 100644 tests/lang/020.phpt create mode 100644 tests/lang/021.phpt create mode 100644 tests/lang/022.phpt create mode 100644 tests/lang/023-1.inc create mode 100644 tests/lang/023-2.inc create mode 100644 tests/lang/023.phpt create mode 100644 tests/lang/024.phpt create mode 100644 tests/lang/025.phpt create mode 100644 tests/lang/026.phpt create mode 100644 tests/lang/027.phpt create mode 100644 tests/lang/028.phpt create mode 100644 tests/lang/030.phpt create mode 100644 tests/lang/031.phpt create mode 100644 tests/lang/032.phpt create mode 100644 tests/lang/033.phpt create mode 100644 tests/lang/034.phpt create mode 100644 tests/lang/035.phpt create mode 100644 tests/lang/036.phpt create mode 100644 tests/lang/037.phpt create mode 100644 tests/lang/038.phpt create mode 100644 tests/lang/039.phpt create mode 100644 tests/lang/040.phpt create mode 100644 tests/lang/041.phpt create mode 100644 tests/lang/042.phpt create mode 100644 tests/lang/043.phpt create mode 100644 tests/lang/044.phpt create mode 100644 tests/lang/045.phpt create mode 100644 tests/lang/array_shortcut_001.phpt create mode 100644 tests/lang/array_shortcut_002.phpt create mode 100644 tests/lang/array_shortcut_003.phpt create mode 100644 tests/lang/array_shortcut_005.phpt create mode 100644 tests/lang/bison1.phpt create mode 100644 tests/lang/bug17115.phpt create mode 100644 tests/lang/bug18872.phpt create mode 100644 tests/lang/bug19566.phpt create mode 100644 tests/lang/bug19943.phpt create mode 100644 tests/lang/bug20175.phpt create mode 100644 tests/lang/bug21094.phpt create mode 100644 tests/lang/bug21600.phpt create mode 100644 tests/lang/bug21669.phpt create mode 100644 tests/lang/bug21820.phpt create mode 100644 tests/lang/bug21849.phpt create mode 100644 tests/lang/bug21961.phpt create mode 100644 tests/lang/bug22231.phpt create mode 100644 tests/lang/bug22510.phpt create mode 100644 tests/lang/bug22592.phpt create mode 100644 tests/lang/bug22690.phpt create mode 100644 tests/lang/bug23279.phpt create mode 100644 tests/lang/bug23384.phpt create mode 100644 tests/lang/bug23489.phpt create mode 100644 tests/lang/bug23524.phpt create mode 100644 tests/lang/bug23584.phpt create mode 100644 tests/lang/bug23624.phpt create mode 100644 tests/lang/bug23922.phpt create mode 100644 tests/lang/bug24054.phpt create mode 100644 tests/lang/bug24396.phpt create mode 100644 tests/lang/bug24403.phpt create mode 100644 tests/lang/bug24436.phpt create mode 100644 tests/lang/bug24499.phpt create mode 100644 tests/lang/bug24573.phpt create mode 100644 tests/lang/bug24640.phpt create mode 100644 tests/lang/bug24652.phpt create mode 100644 tests/lang/bug24658.phpt create mode 100644 tests/lang/bug24783.phpt create mode 100644 tests/lang/bug24908.phpt create mode 100644 tests/lang/bug24926.phpt create mode 100644 tests/lang/bug24951.phpt create mode 100644 tests/lang/bug25145.phpt create mode 100644 tests/lang/bug25547.phpt create mode 100644 tests/lang/bug25652.phpt create mode 100644 tests/lang/bug25922.phpt create mode 100644 tests/lang/bug26182.phpt create mode 100644 tests/lang/bug26696.phpt create mode 100644 tests/lang/bug26866.phpt create mode 100644 tests/lang/bug26869.phpt create mode 100644 tests/lang/bug27354.phpt create mode 100644 tests/lang/bug27439.phpt create mode 100644 tests/lang/bug27443.phpt create mode 100644 tests/lang/bug27535.phpt create mode 100644 tests/lang/bug28213.phpt create mode 100644 tests/lang/bug28800.phpt create mode 100644 tests/lang/bug29566.phpt create mode 100644 tests/lang/bug29893.phpt create mode 100644 tests/lang/bug29944.phpt create mode 100644 tests/lang/bug30578.phpt create mode 100644 tests/lang/bug30638.phpt create mode 100644 tests/lang/bug30726.phpt create mode 100644 tests/lang/bug30862.phpt create mode 100644 tests/lang/bug32828.phpt create mode 100644 tests/lang/bug32924.phpt create mode 100644 tests/lang/bug35176.phpt create mode 100644 tests/lang/bug35382.phpt create mode 100644 tests/lang/bug38579.inc create mode 100644 tests/lang/bug38579.phpt create mode 100644 tests/lang/bug43958.phpt create mode 100644 tests/lang/bug44654.phpt create mode 100644 tests/lang/bug44827.phpt create mode 100644 tests/lang/bug45392.phpt create mode 100644 tests/lang/bug55754.phpt create mode 100644 tests/lang/bug7515.phpt create mode 100644 tests/lang/catchable_error_001.phpt create mode 100644 tests/lang/catchable_error_002.phpt create mode 100644 tests/lang/comments.phpt create mode 100644 tests/lang/comments2.phpt create mode 100644 tests/lang/compare_objects_basic1.phpt create mode 100644 tests/lang/compare_objects_basic2.phpt create mode 100644 tests/lang/each_binary_safety.phpt create mode 100644 tests/lang/empty_variation.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_001.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_002.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_003.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_004.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_005.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_006.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_007.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_008.phpt create mode 100644 tests/lang/engine_assignExecutionOrder_009.phpt create mode 100644 tests/lang/error_2_exception_001.phpt create mode 100644 tests/lang/execution_order.phpt create mode 100644 tests/lang/foreachLoop.001.phpt create mode 100644 tests/lang/foreachLoop.002.phpt create mode 100644 tests/lang/foreachLoop.003.phpt create mode 100644 tests/lang/foreachLoop.004.phpt create mode 100644 tests/lang/foreachLoop.005.phpt create mode 100644 tests/lang/foreachLoop.006.phpt create mode 100644 tests/lang/foreachLoop.007.phpt create mode 100644 tests/lang/foreachLoop.008.phpt create mode 100644 tests/lang/foreachLoop.009.phpt create mode 100644 tests/lang/foreachLoop.010.phpt create mode 100644 tests/lang/foreachLoop.011.phpt create mode 100644 tests/lang/foreachLoop.012.phpt create mode 100644 tests/lang/foreachLoop.013.phpt create mode 100644 tests/lang/foreachLoop.014.phpt create mode 100644 tests/lang/foreachLoop.015.phpt create mode 100644 tests/lang/foreachLoop.016.phpt create mode 100644 tests/lang/foreachLoop.017.phpt create mode 100644 tests/lang/foreachLoopIterator.001.phpt create mode 100644 tests/lang/foreachLoopIterator.002.phpt create mode 100644 tests/lang/foreachLoopIteratorAggregate.001.phpt create mode 100644 tests/lang/foreachLoopIteratorAggregate.002.phpt create mode 100644 tests/lang/foreachLoopIteratorAggregate.003.phpt create mode 100644 tests/lang/foreachLoopIteratorAggregate.004.phpt create mode 100644 tests/lang/foreachLoopObjects.001.phpt create mode 100644 tests/lang/foreachLoopObjects.002.phpt create mode 100644 tests/lang/foreachLoopObjects.003.phpt create mode 100644 tests/lang/foreachLoopObjects.004.phpt create mode 100644 tests/lang/foreachLoopObjects.005.phpt create mode 100644 tests/lang/foreachLoopObjects.006.phpt create mode 100644 tests/lang/foreach_with_object_001.phpt create mode 100644 tests/lang/foreach_with_references_001.phpt create mode 100644 tests/lang/func_get_arg.001.phpt create mode 100644 tests/lang/func_get_arg.002.phpt create mode 100644 tests/lang/func_get_arg.003.phpt create mode 100644 tests/lang/func_get_arg.004.phpt create mode 100644 tests/lang/func_get_arg.005.phpt create mode 100644 tests/lang/func_get_arg_variation.phpt create mode 100644 tests/lang/func_get_args.001.phpt create mode 100644 tests/lang/func_get_args.002.phpt create mode 100644 tests/lang/func_get_args.003.phpt create mode 100644 tests/lang/func_get_args.004.phpt create mode 100644 tests/lang/func_num_args.001.phpt create mode 100644 tests/lang/func_num_args.002.phpt create mode 100644 tests/lang/func_num_args.003.phpt create mode 100644 tests/lang/func_num_args.004.phpt create mode 100644 tests/lang/inc.inc create mode 100644 tests/lang/inc_throw.inc create mode 100644 tests/lang/include_files/echo.inc create mode 100644 tests/lang/include_files/eval.inc create mode 100644 tests/lang/include_files/function.inc create mode 100644 tests/lang/include_variation1.phpt create mode 100644 tests/lang/include_variation2.phpt create mode 100644 tests/lang/include_variation3.phpt create mode 100644 tests/lang/operators/add_basiclong_64bit.phpt create mode 100644 tests/lang/operators/add_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseAnd_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseNot_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseNot_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseOr_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseOr_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseShiftLeft_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt create mode 100644 tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseShiftRight_variationStr.phpt create mode 100644 tests/lang/operators/bitwiseXor_basiclong_64bit.phpt create mode 100644 tests/lang/operators/bitwiseXor_variationStr.phpt create mode 100644 tests/lang/operators/divide_basiclong_64bit.phpt create mode 100644 tests/lang/operators/divide_variationStr.phpt create mode 100644 tests/lang/operators/modulus_basiclong_64bit.phpt create mode 100644 tests/lang/operators/modulus_variationStr.phpt create mode 100644 tests/lang/operators/multiply_basiclong_64bit.phpt create mode 100644 tests/lang/operators/multiply_variationStr.phpt create mode 100644 tests/lang/operators/negate_basiclong_64bit.phpt create mode 100644 tests/lang/operators/negate_variationStr.phpt create mode 100644 tests/lang/operators/operator_equals_basic.phpt create mode 100644 tests/lang/operators/operator_equals_variation.phpt create mode 100644 tests/lang/operators/operator_equals_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_gt_basic.phpt create mode 100644 tests/lang/operators/operator_gt_or_equal_basic.phpt create mode 100644 tests/lang/operators/operator_gt_or_equal_variation.phpt create mode 100644 tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_gt_variation.phpt create mode 100644 tests/lang/operators/operator_gt_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_identical_basic.phpt create mode 100644 tests/lang/operators/operator_identical_variation.phpt create mode 100644 tests/lang/operators/operator_identical_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_lt_basic.phpt create mode 100644 tests/lang/operators/operator_lt_or_equal_basic.phpt create mode 100644 tests/lang/operators/operator_lt_or_equal_variation.phpt create mode 100644 tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_lt_variation.phpt create mode 100644 tests/lang/operators/operator_lt_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_notequals_basic.phpt create mode 100644 tests/lang/operators/operator_notequals_variation.phpt create mode 100644 tests/lang/operators/operator_notequals_variation_64bit.phpt create mode 100644 tests/lang/operators/operator_notidentical_basic.phpt create mode 100644 tests/lang/operators/operator_notidentical_variation.phpt create mode 100644 tests/lang/operators/operator_notidentical_variation_64bit.phpt create mode 100644 tests/lang/operators/postdec_basiclong_64bit.phpt create mode 100644 tests/lang/operators/postdec_variationStr.phpt create mode 100644 tests/lang/operators/postinc_basiclong_64bit.phpt create mode 100644 tests/lang/operators/postinc_variationStr.phpt create mode 100644 tests/lang/operators/predec_basiclong_64bit.phpt create mode 100644 tests/lang/operators/predec_variationStr.phpt create mode 100644 tests/lang/operators/preinc_basiclong_64bit.phpt create mode 100644 tests/lang/operators/preinc_variationStr.phpt create mode 100644 tests/lang/operators/subtract_basiclong_64bit.phpt create mode 100644 tests/lang/operators/subtract_variationStr.phpt create mode 100644 tests/lang/passByReference_001.phpt create mode 100644 tests/lang/passByReference_002.phpt create mode 100644 tests/lang/passByReference_003.phpt create mode 100644 tests/lang/passByReference_004.phpt create mode 100644 tests/lang/passByReference_005.phpt create mode 100644 tests/lang/passByReference_006.phpt create mode 100644 tests/lang/passByReference_007.phpt create mode 100644 tests/lang/passByReference_008.phpt create mode 100644 tests/lang/passByReference_009.phpt create mode 100644 tests/lang/passByReference_010.phpt create mode 100644 tests/lang/passByReference_012.phpt create mode 100644 tests/lang/returnByReference.001.phpt create mode 100644 tests/lang/returnByReference.002.phpt create mode 100644 tests/lang/returnByReference.003.phpt create mode 100644 tests/lang/returnByReference.004.phpt create mode 100644 tests/lang/returnByReference.005.phpt create mode 100644 tests/lang/returnByReference.006.phpt create mode 100644 tests/lang/returnByReference.007.phpt create mode 100644 tests/lang/returnByReference.008.phpt create mode 100644 tests/lang/returnByReference.009.phpt create mode 100644 tests/lang/script_tag.phpt create mode 100644 tests/lang/short_tags.001.phpt create mode 100644 tests/lang/short_tags.002.phpt create mode 100644 tests/lang/short_tags.003.phpt create mode 100644 tests/lang/short_tags.004.phpt create mode 100644 tests/lang/static_basic_001.phpt create mode 100644 tests/lang/static_basic_002.phpt create mode 100644 tests/lang/static_variation_001.phpt create mode 100644 tests/lang/static_variation_002.phpt create mode 100644 tests/lang/string_decimals_001.phpt create mode 100644 tests/lang/this_assignment.phpt create mode 100644 tests/lang/throw_variation_001.phpt create mode 100644 tests/lang/type_hints_001.phpt create mode 100644 tests/lang/type_hints_002.phpt create mode 100644 tests/lang/type_hints_003.phpt create mode 100644 tests/output/bug46897.phpt create mode 100644 tests/output/bug60282.phpt create mode 100644 tests/output/bug60321.phpt create mode 100644 tests/output/bug60322.phpt create mode 100644 tests/output/bug60768.phpt create mode 100644 tests/output/flush_basic_001.phpt create mode 100644 tests/output/flush_error_001.phpt create mode 100644 tests/output/ob_001.phpt create mode 100644 tests/output/ob_002.phpt create mode 100644 tests/output/ob_003.phpt create mode 100644 tests/output/ob_004.phpt create mode 100644 tests/output/ob_005.phpt create mode 100644 tests/output/ob_006.phpt create mode 100644 tests/output/ob_007.phpt create mode 100644 tests/output/ob_008.phpt create mode 100644 tests/output/ob_009.phpt create mode 100644 tests/output/ob_010.phpt create mode 100644 tests/output/ob_011.phpt create mode 100644 tests/output/ob_012.phpt create mode 100644 tests/output/ob_013.phpt create mode 100644 tests/output/ob_014.phpt create mode 100644 tests/output/ob_015.phpt create mode 100644 tests/output/ob_017.phpt create mode 100644 tests/output/ob_018.phpt create mode 100644 tests/output/ob_020.phpt create mode 100644 tests/output/ob_clean_basic_001.phpt create mode 100644 tests/output/ob_clean_error_001.phpt create mode 100644 tests/output/ob_end_clean_basic_001.phpt create mode 100644 tests/output/ob_end_clean_error_001.phpt create mode 100644 tests/output/ob_end_flush_basic_001.phpt create mode 100644 tests/output/ob_end_flush_error_001.phpt create mode 100644 tests/output/ob_flush_basic_001.phpt create mode 100644 tests/output/ob_flush_error_001.phpt create mode 100644 tests/output/ob_get_clean_basic_001.phpt create mode 100644 tests/output/ob_get_clean_basic_002.phpt create mode 100644 tests/output/ob_get_clean_error_001.phpt create mode 100644 tests/output/ob_get_contents_basic_001.phpt create mode 100644 tests/output/ob_get_contents_error_001.phpt create mode 100644 tests/output/ob_get_length_basic_001.phpt create mode 100644 tests/output/ob_get_length_error_001.phpt create mode 100644 tests/output/ob_get_level_basic_001.phpt create mode 100644 tests/output/ob_get_level_error_001.phpt create mode 100644 tests/output/ob_get_status.phpt create mode 100644 tests/output/ob_implicit_flush_basic_001.phpt create mode 100644 tests/output/ob_implicit_flush_basic_002.phpt create mode 100644 tests/output/ob_implicit_flush_error_001.phpt create mode 100644 tests/output/ob_implicit_flush_variation_001.phpt create mode 100644 tests/output/ob_start_basic_001.phpt create mode 100644 tests/output/ob_start_basic_002.phpt create mode 100644 tests/output/ob_start_basic_003.phpt create mode 100644 tests/output/ob_start_basic_004.phpt create mode 100644 tests/output/ob_start_basic_005.phpt create mode 100644 tests/output/ob_start_basic_006.phpt create mode 100644 tests/output/ob_start_basic_unerasable_001.phpt create mode 100644 tests/output/ob_start_basic_unerasable_002.phpt create mode 100644 tests/output/ob_start_basic_unerasable_003.phpt create mode 100644 tests/output/ob_start_basic_unerasable_004.phpt create mode 100644 tests/output/ob_start_basic_unerasable_005.phpt create mode 100644 tests/output/ob_start_callbacks.phpt create mode 100644 tests/output/ob_start_error_001.phpt create mode 100644 tests/output/ob_start_error_002.phpt create mode 100644 tests/output/ob_start_error_003.phpt create mode 100644 tests/output/ob_start_error_004.phpt create mode 100644 tests/output/ob_start_error_005.phpt create mode 100644 tests/quicktester.inc create mode 100644 tests/run-test/test001.phpt create mode 100644 tests/run-test/test002.phpt create mode 100644 tests/run-test/test003.phpt create mode 100644 tests/run-test/test004.phpt create mode 100644 tests/run-test/test005.phpt create mode 100644 tests/run-test/test006.phpt create mode 100644 tests/run-test/test007.phpt create mode 100644 tests/run-test/test008.phpt create mode 100644 tests/run-test/test008a.phpt create mode 100644 tests/run-test/test009.phpt create mode 100644 tests/run-test/test010.phpt create mode 100644 tests/security/bug53226.phpt create mode 100644 tests/security/open_basedir.inc create mode 100644 tests/security/open_basedir_001.phpt create mode 100644 tests/security/open_basedir_chdir.phpt create mode 100644 tests/security/open_basedir_chmod.phpt create mode 100644 tests/security/open_basedir_copy.phpt create mode 100644 tests/security/open_basedir_copy_variation1.phpt create mode 100644 tests/security/open_basedir_dir.phpt create mode 100644 tests/security/open_basedir_disk_free_space.phpt create mode 100644 tests/security/open_basedir_error_log.phpt create mode 100644 tests/security/open_basedir_error_log_variation.phpt create mode 100644 tests/security/open_basedir_file.phpt create mode 100644 tests/security/open_basedir_file_exists.phpt create mode 100644 tests/security/open_basedir_file_get_contents.phpt create mode 100644 tests/security/open_basedir_file_put_contents.phpt create mode 100644 tests/security/open_basedir_fileatime.phpt create mode 100644 tests/security/open_basedir_filectime.phpt create mode 100644 tests/security/open_basedir_filegroup.phpt create mode 100644 tests/security/open_basedir_fileinode.phpt create mode 100644 tests/security/open_basedir_filemtime.phpt create mode 100644 tests/security/open_basedir_fileowner.phpt create mode 100644 tests/security/open_basedir_fileperms.phpt create mode 100644 tests/security/open_basedir_filesize.phpt create mode 100644 tests/security/open_basedir_filetype.phpt create mode 100644 tests/security/open_basedir_fopen.phpt create mode 100644 tests/security/open_basedir_glob.phpt create mode 100644 tests/security/open_basedir_glob_variation.phpt create mode 100644 tests/security/open_basedir_is_dir.phpt create mode 100644 tests/security/open_basedir_is_executable.phpt create mode 100644 tests/security/open_basedir_is_file.phpt create mode 100644 tests/security/open_basedir_is_link.phpt create mode 100644 tests/security/open_basedir_is_readable.phpt create mode 100644 tests/security/open_basedir_is_writable.phpt create mode 100644 tests/security/open_basedir_link.phpt create mode 100644 tests/security/open_basedir_linkinfo.phpt create mode 100644 tests/security/open_basedir_lstat.phpt create mode 100644 tests/security/open_basedir_mkdir.phpt create mode 100644 tests/security/open_basedir_opendir.phpt create mode 100644 tests/security/open_basedir_parse_ini_file.phpt create mode 100644 tests/security/open_basedir_readlink.phpt create mode 100644 tests/security/open_basedir_realpath.phpt create mode 100644 tests/security/open_basedir_rename.phpt create mode 100644 tests/security/open_basedir_rmdir.phpt create mode 100644 tests/security/open_basedir_scandir.phpt create mode 100644 tests/security/open_basedir_stat.phpt create mode 100644 tests/security/open_basedir_symlink.phpt create mode 100644 tests/security/open_basedir_tempnam.phpt create mode 100644 tests/security/open_basedir_touch.phpt create mode 100644 tests/security/open_basedir_unlink.phpt create mode 100644 tests/strings/001.phpt create mode 100644 tests/strings/002.phpt create mode 100644 tests/strings/004.phpt create mode 100644 tests/strings/bug22592.phpt create mode 100644 tests/strings/bug26703.phpt create mode 100644 tests/strings/offsets_chaining_1.phpt create mode 100644 tests/strings/offsets_chaining_2.phpt create mode 100644 tests/strings/offsets_chaining_3.phpt create mode 100644 tests/strings/offsets_chaining_4.phpt create mode 100644 tests/strings/offsets_chaining_5.phpt create mode 100644 tests/strings/offsets_general.phpt (limited to 'tests') diff --git a/tests/basic/001.phpt b/tests/basic/001.phpt new file mode 100644 index 0000000..d0cc1ca --- /dev/null +++ b/tests/basic/001.phpt @@ -0,0 +1,6 @@ +--TEST-- +Trivial "Hello World" test +--FILE-- + +--EXPECT-- +Hello World diff --git a/tests/basic/002.phpt b/tests/basic/002.phpt new file mode 100644 index 0000000..25dc513 --- /dev/null +++ b/tests/basic/002.phpt @@ -0,0 +1,9 @@ +--TEST-- +Simple POST Method test +--POST-- +a=Hello+World +--FILE-- + +--EXPECT-- +Hello World diff --git a/tests/basic/003.phpt b/tests/basic/003.phpt new file mode 100644 index 0000000..43d3be1 --- /dev/null +++ b/tests/basic/003.phpt @@ -0,0 +1,12 @@ +--TEST-- +GET and POST Method combined +--POST-- +a=Hello+World +--GET-- +b=Hello+Again+World&c=Hi+Mom +--FILE-- + +--EXPECT-- +post-a=(Hello World) get-b=(Hello Again World) get-c=(Hi Mom) diff --git a/tests/basic/004.phpt b/tests/basic/004.phpt new file mode 100644 index 0000000..c381e50 --- /dev/null +++ b/tests/basic/004.phpt @@ -0,0 +1,10 @@ +--TEST-- +Two variables in POST data +--POST-- +a=Hello+World&b=Hello+Again+World +--FILE-- + +--EXPECT-- +Hello World Hello Again World diff --git a/tests/basic/005.phpt b/tests/basic/005.phpt new file mode 100644 index 0000000..742e0ca --- /dev/null +++ b/tests/basic/005.phpt @@ -0,0 +1,10 @@ +--TEST-- +Three variables in POST data +--POST-- +a=Hello+World&b=Hello+Again+World&c=1 +--FILE-- + +--EXPECT-- +Hello World Hello Again World 1 diff --git a/tests/basic/006.phpt b/tests/basic/006.phpt new file mode 100644 index 0000000..c614cd9 --- /dev/null +++ b/tests/basic/006.phpt @@ -0,0 +1,6 @@ +--TEST-- +Add 3 variables together and print result +--FILE-- + +--EXPECT-- +6 diff --git a/tests/basic/007.phpt b/tests/basic/007.phpt new file mode 100644 index 0000000..dc808b7 --- /dev/null +++ b/tests/basic/007.phpt @@ -0,0 +1,6 @@ +--TEST-- +Multiply 3 variables and print result +--FILE-- + +--EXPECT-- +64 diff --git a/tests/basic/008.phpt b/tests/basic/008.phpt new file mode 100644 index 0000000..511aef0 --- /dev/null +++ b/tests/basic/008.phpt @@ -0,0 +1,6 @@ +--TEST-- +Divide 3 variables and print result +--FILE-- + +--EXPECT-- +3 diff --git a/tests/basic/009.phpt b/tests/basic/009.phpt new file mode 100644 index 0000000..fefe529 --- /dev/null +++ b/tests/basic/009.phpt @@ -0,0 +1,6 @@ +--TEST-- +Subtract 3 variables and print result +--FILE-- + +--EXPECT-- +10 diff --git a/tests/basic/010.phpt b/tests/basic/010.phpt new file mode 100644 index 0000000..9cdfece --- /dev/null +++ b/tests/basic/010.phpt @@ -0,0 +1,6 @@ +--TEST-- +Testing | and & operators +--FILE-- + +--EXPECT-- +8 diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt new file mode 100644 index 0000000..7925674 --- /dev/null +++ b/tests/basic/011.phpt @@ -0,0 +1,22 @@ +--TEST-- +Testing $argc and $argv handling (GET) +--INI-- +register_argc_argv=1 +--GET-- +ab+cd+ef+123+test +--FILE-- + +--EXPECT-- +0: ab +1: cd +2: ef +3: 123 +4: test diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt new file mode 100644 index 0000000..5c10c7c --- /dev/null +++ b/tests/basic/012.phpt @@ -0,0 +1,25 @@ +--TEST-- +Testing $argc and $argv handling (cli) +--SKIPIF-- + +--INI-- +register_argc_argv=1 +variables_order=GPS +--ARGS-- +ab cd ef 123 test +--FILE-- + +--EXPECT-- +0: ab +1: cd +2: ef +3: 123 +4: test diff --git a/tests/basic/013.phpt b/tests/basic/013.phpt new file mode 100644 index 0000000..376cc06 --- /dev/null +++ b/tests/basic/013.phpt @@ -0,0 +1,13 @@ +--TEST-- +POST Method test and arrays +--POST-- +a[]=1 +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + string(1) "1" +} diff --git a/tests/basic/014.phpt b/tests/basic/014.phpt new file mode 100644 index 0000000..7288c44 --- /dev/null +++ b/tests/basic/014.phpt @@ -0,0 +1,15 @@ +--TEST-- +POST Method test and arrays - 2 +--POST-- +a[]=1&a[]=1 +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(1) "1" + [1]=> + string(1) "1" +} diff --git a/tests/basic/015.phpt b/tests/basic/015.phpt new file mode 100644 index 0000000..eecbaf1 --- /dev/null +++ b/tests/basic/015.phpt @@ -0,0 +1,13 @@ +--TEST-- +POST Method test and arrays - 3 +--POST-- +a[]=1&a[0]=5 +--FILE-- + +--EXPECT-- +array(1) { + [0]=> + string(1) "5" +} diff --git a/tests/basic/016.phpt b/tests/basic/016.phpt new file mode 100644 index 0000000..b34fd1b --- /dev/null +++ b/tests/basic/016.phpt @@ -0,0 +1,15 @@ +--TEST-- +POST Method test and arrays - 4 +--POST-- +a[a]=1&a[b]=3 +--FILE-- + +--EXPECT-- +array(2) { + ["a"]=> + string(1) "1" + ["b"]=> + string(1) "3" +} diff --git a/tests/basic/017.phpt b/tests/basic/017.phpt new file mode 100644 index 0000000..d514726 --- /dev/null +++ b/tests/basic/017.phpt @@ -0,0 +1,17 @@ +--TEST-- +POST Method test and arrays - 5 +--POST-- +a[]=1&a[a]=1&a[b]=3 +--FILE-- + +--EXPECT-- +array(3) { + [0]=> + string(1) "1" + ["a"]=> + string(1) "1" + ["b"]=> + string(1) "3" +} diff --git a/tests/basic/018.phpt b/tests/basic/018.phpt new file mode 100644 index 0000000..45996b2 --- /dev/null +++ b/tests/basic/018.phpt @@ -0,0 +1,34 @@ +--TEST-- +POST Method test and arrays - 6 +--POST-- +a[][]=1&a[][]=3&b[a][b][c]=1&b[a][b][d]=1 +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + array(1) { + [0]=> + string(1) "1" + } + [1]=> + array(1) { + [0]=> + string(1) "3" + } +} +array(1) { + ["a"]=> + array(1) { + ["b"]=> + array(2) { + ["c"]=> + string(1) "1" + ["d"]=> + string(1) "1" + } + } +} diff --git a/tests/basic/019.phpt b/tests/basic/019.phpt new file mode 100644 index 0000000..3bece24 --- /dev/null +++ b/tests/basic/019.phpt @@ -0,0 +1,17 @@ +--TEST-- +POST Method test and arrays - 7 +--POST-- +a[]=1&a[]]=3&a[[]=4 +--FILE-- + +--EXPECT-- +array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "3" + ["["]=> + string(1) "4" +} diff --git a/tests/basic/020.phpt b/tests/basic/020.phpt new file mode 100644 index 0000000..c94a604 --- /dev/null +++ b/tests/basic/020.phpt @@ -0,0 +1,15 @@ +--TEST-- +POST Method test and arrays - 8 +--POST-- +a[a[]]=1&a[b[]]=3 +--FILE-- + +--EXPECT-- +array(2) { + ["a["]=> + string(1) "1" + ["b["]=> + string(1) "3" +} diff --git a/tests/basic/021.phpt b/tests/basic/021.phpt new file mode 100644 index 0000000..eeaf588 --- /dev/null +++ b/tests/basic/021.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #37276 (problems witch $_POST array) +--INI-- +file_uploads=1 +upload_tmp_dir=. +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="submitter" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="pics"; filename="bug37276.txt" +Content-Type: text/plain + +bug37276 + +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(1) { + ["pics"]=> + array(5) { + ["name"]=> + string(12) "bug37276.txt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(9) + } +} +array(1) { + ["submitter"]=> + string(8) "testname" +} diff --git a/tests/basic/022.phpt b/tests/basic/022.phpt new file mode 100644 index 0000000..0ab70d4 --- /dev/null +++ b/tests/basic/022.phpt @@ -0,0 +1,34 @@ +--TEST-- +Cookies test#1 +--INI-- +max_input_vars=1000 +filter.default=unsafe_raw +--COOKIE-- +cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie 5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;- & % $cookie 10=10 +--FILE-- + +--EXPECT-- +array(10) { + ["cookie1"]=> + string(6) "val1 " + ["cookie2"]=> + string(5) "val2 " + ["cookie3"]=> + string(6) "val 3." + ["cookie_4"]=> + string(10) " value 4 ;" + ["cookie__5"]=> + string(7) " value" + ["cookie_6"]=> + string(3) "þæö" + ["cookie_7"]=> + string(0) "" + ["$cookie_8"]=> + string(0) "" + ["cookie-9"]=> + string(1) "1" + ["-_&_%_$cookie_10"]=> + string(2) "10" +} diff --git a/tests/basic/023.phpt b/tests/basic/023.phpt new file mode 100644 index 0000000..ca5f1dc --- /dev/null +++ b/tests/basic/023.phpt @@ -0,0 +1,20 @@ +--TEST-- +Cookies test#2 +--INI-- +max_input_vars=1000 +filter.default=unsafe_raw +--COOKIE-- +c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","value",UEhQIQ==;UEhQIQ==foo +--FILE-- + +--EXPECT-- +array(3) { + ["c_o_o_k_i_e"]=> + string(5) "value" + ["name"]=> + string(24) ""value","value",UEhQIQ==" + ["UEhQIQ"]=> + string(4) "=foo" +} diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt new file mode 100644 index 0000000..bf8a206 --- /dev/null +++ b/tests/basic/024.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test HTTP_RAW_POST_DATA creation +--INI-- +always_populate_raw_post_data=1 +max_input_vars=1000 +--POST-- +a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3 +--FILE-- + +--EXPECT-- +array(3) { + ["a"]=> + string(3) "ABC" + ["y"]=> + string(3) "XYZ" + ["c"]=> + array(3) { + [0]=> + string(1) "1" + [1]=> + string(1) "2" + ["a"]=> + string(1) "3" + } +} +string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3" diff --git a/tests/basic/025.phpt b/tests/basic/025.phpt new file mode 100644 index 0000000..58191bc --- /dev/null +++ b/tests/basic/025.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test HTTP_RAW_POST_DATA with excessive post length +--INI-- +always_populate_raw_post_data=1 +post_max_size=1K +--POST-- +a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +--FILE-- + +--EXPECTF-- +Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 bytes in Unknown on line 0 + +Warning: Cannot modify header information - headers already sent in Unknown on line 0 + +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +array(0) { +} +NULL diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt new file mode 100644 index 0000000..b98a31f --- /dev/null +++ b/tests/basic/026.phpt @@ -0,0 +1,15 @@ +--TEST-- +Registration of HTTP_RAW_POST_DATA due to unknown content-type +--INI-- +always_populate_raw_post_data=0 +--POST_RAW-- +Content-Type: unknown/type +a=1&b=ZYX +--FILE-- + +--EXPECT-- +array(0) { +} +string(9) "a=1&b=ZYX" diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt new file mode 100644 index 0000000..0528e83 --- /dev/null +++ b/tests/basic/027.phpt @@ -0,0 +1,33 @@ +--TEST-- +Handling of max_input_nesting_level being reached +--INI-- +always_populate_raw_post_data=0 +display_errors=0 +max_input_nesting_level=10 +max_input_vars=1000 +track_errors=1 +log_errors=0 +--POST-- +a=1&b=ZYX&c[][][][][][][][][][][][][][][][][][][][][][]=123&d=123&e[][]][]=3 +--FILE-- + +--EXPECT-- +array(4) { + ["a"]=> + string(1) "1" + ["b"]=> + string(3) "ZYX" + ["d"]=> + string(3) "123" + ["e"]=> + array(1) { + [0]=> + array(1) { + [0]=> + string(1) "3" + } + } +} +string(115) "Unknown: Input variable nesting level exceeded 10. To increase the limit change max_input_nesting_level in php.ini." diff --git a/tests/basic/028.phpt b/tests/basic/028.phpt new file mode 100644 index 0000000..37d6f21 --- /dev/null +++ b/tests/basic/028.phpt @@ -0,0 +1,105 @@ +--TEST-- +RFC1867 character quotting +--INI-- +file_uploads=1 +max_input_vars=1000 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name1 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name2' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name3" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\4 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\\5 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\'6 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\"7 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\8' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\\9' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\'10' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\"11' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\12" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\\13" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\'14" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\"15" + +testname +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECT-- +array(15) { + ["name1"]=> + string(8) "testname" + ["name2"]=> + string(8) "testname" + ["name3"]=> + string(8) "testname" + ["name\4"]=> + string(8) "testname" + ["name\5"]=> + string(8) "testname" + ["name\'6"]=> + string(8) "testname" + ["name\"7"]=> + string(8) "testname" + ["name\8"]=> + string(8) "testname" + ["name\9"]=> + string(8) "testname" + ["name'10"]=> + string(8) "testname" + ["name\"11"]=> + string(8) "testname" + ["name\12"]=> + string(8) "testname" + ["name\13"]=> + string(8) "testname" + ["name\'14"]=> + string(8) "testname" + ["name"15"]=> + string(8) "testname" +} diff --git a/tests/basic/029.phpt b/tests/basic/029.phpt new file mode 100644 index 0000000..6d95c07 --- /dev/null +++ b/tests/basic/029.phpt @@ -0,0 +1,51 @@ +--TEST-- +Shift_JIS request +--SKIPIF-- + +--INI-- +file_uploads=1 +mbstring.encoding_translation=1 +mbstring.http_input=Shift_JIS +mbstring.internal_encoding=UTF-8 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="—\Ž\”\" + +ƒhƒŒƒ~ƒtƒ@ƒ\ +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="pics"; filename="file1.txt" +Content-Type: text/plain + +file1 + +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(1) { + ["pics"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(6) + } +} +array(1) { + ["予蚕胜"]=> + string(18) "ドレミファ゜" +} diff --git a/tests/basic/030.phpt b/tests/basic/030.phpt new file mode 100644 index 0000000..cf2a270 --- /dev/null +++ b/tests/basic/030.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv-- +--FILE-- + +--EXPECT-- +array(1) { + ["data"]=> + string(3) "abc" +} diff --git a/tests/basic/031.phpt b/tests/basic/031.phpt new file mode 100644 index 0000000..12b8354 --- /dev/null +++ b/tests/basic/031.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv +Content-Disposition: form-data; name="data2" + +more data +--BVoyv +Content-Disposition: form-data; name="data3" + +even more data +--BVoyv-- +--FILE-- + +--EXPECT-- +array(3) { + ["data"]=> + string(3) "abc" + ["data2"]=> + string(9) "more data" + ["data3"]=> + string(14) "even more data" +} diff --git a/tests/basic/032.phpt b/tests/basic/032.phpt new file mode 100644 index 0000000..a6aba5b --- /dev/null +++ b/tests/basic/032.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug#18792 (no form variables after multipart/form-data) +--INI-- +file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=BVoyv, charset=iso-8859-1 +--BVoyv +Content-Disposition: form-data; name="data" + +abc +--BVoyv-- +--FILE-- + +--EXPECT-- +array(1) { + ["data"]=> + string(3) "abc" +} diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt new file mode 100644 index 0000000..1406ce0 --- /dev/null +++ b/tests/basic/bug20539.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #20539 (PHP CLI Segmentation Fault) +--SKIPIF-- + + +--INI-- +session.auto_start=1 +session.save_handler=files +session.save_path=./tests/basic/ +--FILE-- + +--EXPECT-- +good :) +bool(true) + diff --git a/tests/basic/bug29971.phpt b/tests/basic/bug29971.phpt new file mode 100644 index 0000000..d4b654b --- /dev/null +++ b/tests/basic/bug29971.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #29971 (variables_order behaviour) +--INI-- +variables_order=GPC +--FILE-- + +--EXPECT-- +array(0) { +} +array(0) { +} +string(3) "GPC" diff --git a/tests/basic/bug45986.phpt b/tests/basic/bug45986.phpt new file mode 100644 index 0000000..1c30f10 --- /dev/null +++ b/tests/basic/bug45986.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #45986 (wrong error message for a non existant file on rename) +--CREDITS-- +Sebastian SchÃŒrmann +sebs@php.net +Testfest 2009 Munich +--FILE-- + +--EXPECTF-- +Warning: %s in %sbug45986.php on line 2 diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt new file mode 100644 index 0000000..3f2d544 --- /dev/null +++ b/tests/basic/bug51709_1.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #51709 (Can't use keywords as method names) +--FILE-- + +===DONE=== + +--EXPECTF-- +Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_1.php on line %d diff --git a/tests/basic/bug51709_2.phpt b/tests/basic/bug51709_2.phpt new file mode 100644 index 0000000..bb1f91c --- /dev/null +++ b/tests/basic/bug51709_2.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #51709 (Can't use keywords as method names) +--FILE-- + +===DONE=== + +--EXPECTF-- +Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_2.php on line %d diff --git a/tests/basic/bug53180.phpt b/tests/basic/bug53180.phpt new file mode 100644 index 0000000..5c2eb76 --- /dev/null +++ b/tests/basic/bug53180.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #53180 (post_max_size=0 partly not working) +--INI-- +post_max_size=0 +--POST-- +email=foo&password=bar&submit=Log+on +--FILE-- + +--EXPECT-- +array(3) { + ["email"]=> + string(3) "foo" + ["password"]=> + string(3) "bar" + ["submit"]=> + string(6) "Log on" +} diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt new file mode 100644 index 0000000..0c5595e --- /dev/null +++ b/tests/basic/bug54514.phpt @@ -0,0 +1,12 @@ +--TEST-- +Req #54514 (Get php binary path during script execution) +--FILE-- + +--EXPECTF-- +array(1) { + [%u|b%"file"]=> + array(5) { + [%u|b%"name"]=> + array(1) { + [0]=> + %unicode|string%(9) "file1.txt" + } + [%u|b%"type"]=> + array(1) { + [0]=> + %unicode|string%(16) "text/plain-file1" + } + [%u|b%"tmp_name"]=> + array(1) { + [0]=> + %unicode|string%(%d) "%s" + } + [%u|b%"error"]=> + array(1) { + [0]=> + int(0) + } + [%u|b%"size"]=> + array(1) { + [0]=> + int(1) + } + } +} +array(0) { +} diff --git a/tests/basic/bug61000.phpt b/tests/basic/bug61000.phpt new file mode 100644 index 0000000..8149d68 --- /dev/null +++ b/tests/basic/bug61000.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #61000 (Exceeding max nesting level doesn't delete numerical vars) +--INI-- +max_input_nesting_level=2 +--POST-- +1[a][]=foo&1[a][b][c]=bar +--GET-- +a[a][]=foo&a[a][b][c]=bar +--FILE-- + +--EXPECT-- +PHPE9568F36-D428-11d2-A769-00AA001ACF42 + +--CREDITS-- +Jason Easter +PHPUG WÃŒrzburg +Testfest 2009 2009-06-20 \ No newline at end of file diff --git a/tests/basic/php_logo_guid.phpt b/tests/basic/php_logo_guid.phpt new file mode 100644 index 0000000..b5724a9 --- /dev/null +++ b/tests/basic/php_logo_guid.phpt @@ -0,0 +1,10 @@ +--TEST-- +Testing php_logo_guid() function +--FILE-- + +--EXPECT-- +PHPE9568F34-D428-11d2-A769-00AA001ACF42 +--CREDITS-- +Testfest 2009 2009-06-20 \ No newline at end of file diff --git a/tests/basic/php_real_logo_guid.phpt b/tests/basic/php_real_logo_guid.phpt new file mode 100644 index 0000000..2b9003a --- /dev/null +++ b/tests/basic/php_real_logo_guid.phpt @@ -0,0 +1,12 @@ +--TEST-- +Testing php_real_logo_guid() function +--FILE-- + +--EXPECT-- +PHPE9568F34-D428-11d2-A769-00AA001ACF42 +--CREDITS-- +Jason Easter +PHPUG WÃŒrzburg +Testfest 2009 2009-06-20 \ No newline at end of file diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt new file mode 100644 index 0000000..d008286 --- /dev/null +++ b/tests/basic/req44164.phpt @@ -0,0 +1,17 @@ +--TEST-- +Req #44164 (Handle "Content-Length" HTTP header when zlib.output_compression active) +--SKIPIF-- + +--INI-- +zlib.output_compression=On +--ENV-- +HTTP_ACCEPT_ENCODING=gzip +--FILE-- + +--EXPECTF-- +array(2) { + [%d]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file1" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%d]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file2" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(0) { +} diff --git a/tests/basic/rfc1867_array_upload.phpt b/tests/basic/rfc1867_array_upload.phpt new file mode 100644 index 0000000..d9f9353 --- /dev/null +++ b/tests/basic/rfc1867_array_upload.phpt @@ -0,0 +1,84 @@ +--TEST-- +rfc1867 array upload +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +max_file_uploads=10 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file[]"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file[2]"; filename="file2.txt" +Content-Type: text/plain-file2 + +2 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file[]"; filename="file3.txt" +Content-Type: text/plain-file3 + +3 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(1) { + [%u|b%"file"]=> + array(5) { + [%u|b%"name"]=> + array(3) { + [0]=> + %unicode|string%(9) "file1.txt" + [2]=> + %unicode|string%(9) "file2.txt" + [3]=> + %unicode|string%(9) "file3.txt" + } + [%u|b%"type"]=> + array(3) { + [0]=> + %unicode|string%(16) "text/plain-file1" + [2]=> + %unicode|string%(16) "text/plain-file2" + [3]=> + %unicode|string%(16) "text/plain-file3" + } + [%u|b%"tmp_name"]=> + array(3) { + [0]=> + %unicode|string%(%d) "%s" + [2]=> + %unicode|string%(%d) "%s" + [3]=> + %unicode|string%(%d) "%s" + } + [%u|b%"error"]=> + array(3) { + [0]=> + int(0) + [2]=> + int(0) + [3]=> + int(0) + } + [%u|b%"size"]=> + array(3) { + [0]=> + int(1) + [2]=> + int(1) + [3]=> + int(1) + } + } +} +array(0) { +} diff --git a/tests/basic/rfc1867_boundary_1.phpt b/tests/basic/rfc1867_boundary_1.phpt new file mode 100644 index 0000000..fe0a9f2 --- /dev/null +++ b/tests/basic/rfc1867_boundary_1.phpt @@ -0,0 +1,25 @@ +--TEST-- +rfc1867 boundary 1 +--INI-- +post_max_size=1024 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data; boundary="------------------------------------foobar" +--------------------------------------foobar +Content-Disposition: form-data; name="foobar" + +1 +--------------------------------------foobar-- +--FILE-- + +--EXPECTF-- +array(0) { +} +array(1) { + [%u|b%"foobar"]=> + %unicode|string%(1) "1" +} diff --git a/tests/basic/rfc1867_boundary_2.phpt b/tests/basic/rfc1867_boundary_2.phpt new file mode 100644 index 0000000..256ec4b --- /dev/null +++ b/tests/basic/rfc1867_boundary_2.phpt @@ -0,0 +1,25 @@ +--TEST-- +rfc1867 boundary 2 +--INI-- +post_max_size=1024 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data; boundary=------------------------------------foo, bar +--------------------------------------foo +Content-Disposition: form-data; name="foobar" + +1 +--------------------------------------foo-- +--FILE-- + +--EXPECTF-- +array(0) { +} +array(1) { + [%u|b%"foobar"]=> + %unicode|string%(1) "1" +} diff --git a/tests/basic/rfc1867_empty_upload.phpt b/tests/basic/rfc1867_empty_upload.phpt new file mode 100644 index 0000000..c2dcb9b --- /dev/null +++ b/tests/basic/rfc1867_empty_upload.phpt @@ -0,0 +1,89 @@ +--TEST-- +rfc1867 empty upload +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +max_file_uploads=10 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foo" + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="" +Content-Type: text/plain-file2 + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="file3.txt" +Content-Type: text/plain-file3 + +3 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(3) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file1" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(0) "" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(0) "" + [%u|b%"error"]=> + int(4) + [%u|b%"size"]=> + int(0) + } + [%u|b%"file3"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file3.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file3" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(1) { + [%u|b%"foo"]=> + %unicode|string%(0) "" +} +string(1) "1" +string(1) "3" diff --git a/tests/basic/rfc1867_file_upload_disabled.phpt b/tests/basic/rfc1867_file_upload_disabled.phpt new file mode 100644 index 0000000..99dee9b --- /dev/null +++ b/tests/basic/rfc1867_file_upload_disabled.phpt @@ -0,0 +1,36 @@ +--TEST-- +rfc1867 file_upload disabled +--INI-- +file_uploads=0 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foo" + +bar +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="bar" + +foo +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(0) { +} +array(2) { + [%u|b%"foo"]=> + %unicode|string%(3) "bar" + [%u|b%"bar"]=> + %unicode|string%(3) "foo" +} diff --git a/tests/basic/rfc1867_garbled_mime_headers.phpt b/tests/basic/rfc1867_garbled_mime_headers.phpt new file mode 100644 index 0000000..4010f22 --- /dev/null +++ b/tests/basic/rfc1867_garbled_mime_headers.phpt @@ -0,0 +1,25 @@ +--TEST-- +rfc1867 garbled mime headers +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data + + +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Warning: File Upload Mime headers garbled in %s +array(0) { +} +array(0) { +} diff --git a/tests/basic/rfc1867_invalid_boundary.phpt b/tests/basic/rfc1867_invalid_boundary.phpt new file mode 100644 index 0000000..cb27675 --- /dev/null +++ b/tests/basic/rfc1867_invalid_boundary.phpt @@ -0,0 +1,24 @@ +--TEST-- +rfc1867 invalid boundary +--INI-- +post_max_size=1024 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data; boundary="foobar +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foobar" + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Warning: Invalid boundary in multipart/form-data POST data in %s +array(0) { +} +array(0) { +} diff --git a/tests/basic/rfc1867_malicious_input.phpt b/tests/basic/rfc1867_malicious_input.phpt new file mode 100644 index 0000000..40b43d2 --- /dev/null +++ b/tests/basic/rfc1867_malicious_input.phpt @@ -0,0 +1,25 @@ +--TEST-- +rfc1867 malicious input +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foo[]bar"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(0) { +} +array(0) { +} diff --git a/tests/basic/rfc1867_max_file_size.phpt b/tests/basic/rfc1867_max_file_size.phpt new file mode 100644 index 0000000..9c576b4 --- /dev/null +++ b/tests/basic/rfc1867_max_file_size.phpt @@ -0,0 +1,89 @@ +--TEST-- +rfc1867 MAX_FILE_SIZE +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +max_file_uploads=10 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="MAX_FILE_SIZE" + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" +Content-Type: text/plain-file2 + +22 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="C:\foo\bar/file3.txt" +Content-Type: text/plain-file3; + +3 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(3) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file1" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(0) "" + [%u|b%"error"]=> + int(2) + [%u|b%"size"]=> + int(0) + } + [%u|b%"file3"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file3.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file3" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(1) { + [%u|b%"MAX_FILE_SIZE"]=> + %string|unicode%(1) "1" +} +string(1) "1" +string(1) "3" diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt new file mode 100644 index 0000000..76327fd --- /dev/null +++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt @@ -0,0 +1,101 @@ +--TEST-- +rfc1867 max_file_uploads - empty files shouldn't count (non-debug version) +--SKIPIF-- + +--INI-- +file_uploads=1 +error_reporting=E_ALL +max_file_uploads=2 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="" +Content-Type: text/plain-file + +33 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file4"; filename="file4.txt" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(4) { + ["file2"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file3"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file4"]=> + array(5) { + ["name"]=> + string(9) "file4.txt" + ["type"]=> + string(15) "text/plain-file" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(0) + } + ["file1"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(15) "text/plain-file" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(1) + } +} +array(0) { +} +string(1) "1" +string(0) "" diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt new file mode 100644 index 0000000..279851c --- /dev/null +++ b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt @@ -0,0 +1,102 @@ +--TEST-- +rfc1867 max_file_uploads - empty files shouldn't count (debug version) +--SKIPIF-- + +--INI-- +file_uploads=1 +error_reporting=E_ALL +max_file_uploads=1 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="" +Content-Type: text/plain-file + +33 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file4"; filename="file4.txt" +Content-Type: text/plain-file + + +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Notice: No file uploaded in Unknown on line 0 + +Notice: No file uploaded in Unknown on line 0 + +Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0 +array(4) { + ["file2"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file3"]=> + array(5) { + ["name"]=> + string(0) "" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(4) + ["size"]=> + int(0) + } + ["file4"]=> + array(5) { + ["name"]=> + string(9) "file4.txt" + ["type"]=> + string(0) "" + ["tmp_name"]=> + string(0) "" + ["error"]=> + int(5) + ["size"]=> + int(0) + } + ["file1"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(15) "text/plain-file" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(1) + } +} +array(0) { +} +string(1) "1" diff --git a/tests/basic/rfc1867_missing_boundary.phpt b/tests/basic/rfc1867_missing_boundary.phpt new file mode 100644 index 0000000..6218b13 --- /dev/null +++ b/tests/basic/rfc1867_missing_boundary.phpt @@ -0,0 +1,24 @@ +--TEST-- +rfc1867 missing boundary +--INI-- +post_max_size=1024 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foobar" + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Warning: Missing boundary in multipart/form-data POST data in %s +array(0) { +} +array(0) { +} diff --git a/tests/basic/rfc1867_missing_boundary_2.phpt b/tests/basic/rfc1867_missing_boundary_2.phpt new file mode 100644 index 0000000..a8f38ae --- /dev/null +++ b/tests/basic/rfc1867_missing_boundary_2.phpt @@ -0,0 +1,37 @@ +--TEST-- +rfc1867 missing boundary 2 +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1024 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +--FILE-- + +--EXPECTF-- +array(1) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(0) "" + [%u|b%"error"]=> + int(3) + [%u|b%"size"]=> + int(0) + } +} +array(0) { +} diff --git a/tests/basic/rfc1867_post_max_filesize.phpt b/tests/basic/rfc1867_post_max_filesize.phpt new file mode 100644 index 0000000..04c0c5c --- /dev/null +++ b/tests/basic/rfc1867_post_max_filesize.phpt @@ -0,0 +1,83 @@ +--TEST-- +rfc1867 post_max_filesize +--INI-- +file_uploads=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +upload_max_filesize=1 +max_file_uploads=10 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file1 + +1 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file2"; filename="file2.txt" +Content-Type: text/plain-file2 + +22 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file3"; filename="file3.txt" +Content-Type: text/plain-file3 + +3 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +array(3) { + [%u|b%"file1"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file1.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file1" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } + [%u|b%"file2"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file2.txt" + [%u|b%"type"]=> + %string|unicode%(0) "" + [%u|b%"tmp_name"]=> + %string|unicode%(0) "" + [%u|b%"error"]=> + int(1) + [%u|b%"size"]=> + int(0) + } + [%u|b%"file3"]=> + array(5) { + [%u|b%"name"]=> + %string|unicode%(9) "file3.txt" + [%u|b%"type"]=> + %string|unicode%(16) "text/plain-file3" + [%u|b%"tmp_name"]=> + %string|unicode%(%d) "%s" + [%u|b%"error"]=> + int(0) + [%u|b%"size"]=> + int(1) + } +} +array(0) { +} +string(1) "1" +string(1) "3" diff --git a/tests/basic/rfc1867_post_max_size.phpt b/tests/basic/rfc1867_post_max_size.phpt new file mode 100644 index 0000000..9228135 --- /dev/null +++ b/tests/basic/rfc1867_post_max_size.phpt @@ -0,0 +1,24 @@ +--TEST-- +rfc1867 post_max_size +--INI-- +post_max_size=1 +error_reporting=E_ALL&~E_NOTICE +comment=debug builds show some additional E_NOTICE errors +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="foobar" + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- + +--EXPECTF-- +Warning: POST Content-Length of %d bytes exceeds the limit of 1 bytes in %s +array(0) { +} +array(0) { +} diff --git a/tests/basic/zend_logo_guid.phpt b/tests/basic/zend_logo_guid.phpt new file mode 100644 index 0000000..23ca016 --- /dev/null +++ b/tests/basic/zend_logo_guid.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing zend_logo_guid() function +--FILE-- + +--EXPECT-- +PHPE9568F35-D428-11d2-A769-00AA001ACF42 + +--CREDITS-- +Jason Easter +PHPUG WÃŒrzburg +Testfest 2009 2009-06-20 \ No newline at end of file diff --git a/tests/classes/__call_001.phpt b/tests/classes/__call_001.phpt new file mode 100644 index 0000000..f9708e0 --- /dev/null +++ b/tests/classes/__call_001.phpt @@ -0,0 +1,42 @@ +--TEST-- +ZE2 __call() +--SKIPIF-- + +--FILE-- +x; + } +} + +$foo = new Caller(); +$a = $foo->test(1, '2', 3.4, true); +var_dump($a); + +?> +--EXPECT-- +Method test called: +array(4) { + [0]=> + int(1) + [1]=> + string(1) "2" + [2]=> + float(3.4) + [3]=> + bool(true) +} +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} diff --git a/tests/classes/__call_002.phpt b/tests/classes/__call_002.phpt new file mode 100644 index 0000000..53a179f --- /dev/null +++ b/tests/classes/__call_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +ZE2 __call() signature check +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Method Test::__call() must take exactly 2 arguments in %s__call_002.php on line %d diff --git a/tests/classes/__call_003.phpt b/tests/classes/__call_003.phpt new file mode 100644 index 0000000..c7aa95c --- /dev/null +++ b/tests/classes/__call_003.phpt @@ -0,0 +1,33 @@ +--TEST-- +Force pass-by-reference to __call +--FILE-- +f($a); + $c->f($b); + + var_dump($a, $b); +?> +--EXPECTF-- +array(1) { + [0]=> + string(8) "original" +} +array(1) { + [0]=> + &string(7) "changed" +} + diff --git a/tests/classes/__call_004.phpt b/tests/classes/__call_004.phpt new file mode 100644 index 0000000..2072112 --- /dev/null +++ b/tests/classes/__call_004.phpt @@ -0,0 +1,41 @@ +--TEST-- +When __call() is invoked via ::, ensure current scope's __call() is favoured over the specified class's __call(). +--FILE-- +test(); +?> +--EXPECTF-- +In B::__call(test1, array(1,a)) +object(B)#1 (0) { +} +In B::__call(test2, array(1,a)) +object(B)#1 (0) { +} +In B::__call(test3, array(1,a)) +object(B)#1 (0) { +} +In B::__call(test4, array(1,a)) +object(B)#1 (0) { +} \ No newline at end of file diff --git a/tests/classes/__call_005.phpt b/tests/classes/__call_005.phpt new file mode 100644 index 0000000..6e15848 --- /dev/null +++ b/tests/classes/__call_005.phpt @@ -0,0 +1,37 @@ +--TEST-- +When __call() is invoked via ::, ensure private implementation of __call() in superclass is accessed without error. +--FILE-- +test(); +?> +--EXPECTF-- +Warning: The magic method __call() must have public visibility and cannot be static in %s__call_005.php on line 3 +In A::__call(test1, array(1,a)) +object(B)#1 (0) { +} +In A::__call(test2, array(1,a)) +object(B)#1 (0) { +} +In A::__call(test3, array(1,a)) +object(B)#1 (0) { +} +In A::__call(test4, array(1,a)) +object(B)#1 (0) { +} diff --git a/tests/classes/__call_006.phpt b/tests/classes/__call_006.phpt new file mode 100644 index 0000000..a65fafb --- /dev/null +++ b/tests/classes/__call_006.phpt @@ -0,0 +1,77 @@ +--TEST-- +Ensure exceptions are handled properly when thrown in __call. +--FILE-- + Invoke __call via simple method call.\n"; +try { + $a->unknown(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; +try { + $a->test(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; +$b = new B(); +try { + $b->test(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via callback.\n"; +try { + call_user_func(array($b, 'unknownCallback'), 1,2,3); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} +?> +==DONE== +--EXPECTF-- +---> Invoke __call via simple method call. +object(A)#%d (0) { +} +Exception caught OK; continuing. + + +---> Invoke __call via scope resolution operator within instance. +object(A)#%d (0) { +} +Exception caught OK; continuing. + + +---> Invoke __call via scope resolution operator within child instance. +object(B)#%d (0) { +} +Exception caught OK; continuing. + + +---> Invoke __call via callback. +object(B)#%d (0) { +} +Exception caught OK; continuing. +==DONE== \ No newline at end of file diff --git a/tests/classes/__call_007.phpt b/tests/classes/__call_007.phpt new file mode 100644 index 0000000..d79dba3 --- /dev/null +++ b/tests/classes/__call_007.phpt @@ -0,0 +1,74 @@ +--TEST-- +Ensure exceptions are handled properly when thrown in a statically declared __call. +--FILE-- + Invoke __call via simple method call.\n"; +try { + $a->unknown(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via scope resolution operator within instance.\n"; +try { + $a->test(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n"; +$b = new B(); +try { + $b->test(); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} + +echo "\n\n---> Invoke __call via callback.\n"; +try { + call_user_func(array($b, 'unknownCallback'), 1,2,3); +} catch (Exception $e) { + echo "Exception caught OK; continuing.\n"; +} +?> +==DONE== +--EXPECTF-- +Warning: The magic method __call() must have public visibility and cannot be static in %s on line 3 +---> Invoke __call via simple method call. +NULL +Exception caught OK; continuing. + + +---> Invoke __call via scope resolution operator within instance. +NULL +Exception caught OK; continuing. + + +---> Invoke __call via scope resolution operator within child instance. +NULL +Exception caught OK; continuing. + + +---> Invoke __call via callback. +NULL +Exception caught OK; continuing. +==DONE== \ No newline at end of file diff --git a/tests/classes/__set__get_001.phpt b/tests/classes/__set__get_001.phpt new file mode 100644 index 0000000..beb688c --- /dev/null +++ b/tests/classes/__set__get_001.phpt @@ -0,0 +1,72 @@ +--TEST-- +ZE2 __set() and __get() +--SKIPIF-- + +--FILE-- + 1, 'b' => 2, 'c' => 3); + + function __get($nm) { + echo "Getting [$nm]\n"; + + if (isset($this->x[$nm])) { + $r = $this->x[$nm]; + echo "Returning: $r\n"; + return $r; + } + else { + echo "Nothing!\n"; + } + } + + function __set($nm, $val) { + echo "Setting [$nm] to $val\n"; + + if (isset($this->x[$nm])) { + $this->x[$nm] = $val; + echo "OK!\n"; + } + else { + echo "Not OK!\n"; + } + } +} + +$foo = new Setter(); + +// this doesn't go through __set()... should it? +$foo->n = 1; + +// the rest are fine... +$foo->a = 100; +$foo->a++; +$foo->z++; +var_dump($foo); + +?> +--EXPECTF-- +Setting [a] to 100 +OK! +Getting [a] +Returning: 100 +Setting [a] to 101 +OK! +Getting [z] +Nothing! +Setting [z] to 1 +Not OK! +object(setter)#%d (2) { + ["n"]=> + int(1) + ["x"]=> + array(3) { + ["a"]=> + int(101) + ["b"]=> + int(2) + ["c"]=> + int(3) + } +} diff --git a/tests/classes/__set__get_002.phpt b/tests/classes/__set__get_002.phpt new file mode 100644 index 0000000..71111cc --- /dev/null +++ b/tests/classes/__set__get_002.phpt @@ -0,0 +1,14 @@ +--TEST-- +ZE2 __get() signature check +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Method Test::__get() must take exactly 1 argument in %s__set__get_002.php on line %d diff --git a/tests/classes/__set__get_003.phpt b/tests/classes/__set__get_003.phpt new file mode 100644 index 0000000..390d303 --- /dev/null +++ b/tests/classes/__set__get_003.phpt @@ -0,0 +1,14 @@ +--TEST-- +ZE2 __set() signature check +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Method Test::__set() must take exactly 2 arguments in %s__set__get_003.php on line %d diff --git a/tests/classes/__set__get_004.phpt b/tests/classes/__set__get_004.phpt new file mode 100644 index 0000000..e3061da --- /dev/null +++ b/tests/classes/__set__get_004.phpt @@ -0,0 +1,39 @@ +--TEST-- +ZE2 __set() and __get() +--SKIPIF-- + +--FILE-- +x[$name])) { + return $this->x[$name]; + } + else + { + return NULL; + } + } + + function __set($name, $val) { + $this->x[$name] = $val; + } +} + +$foo = new Test(); +$bar = new Test(); +$bar->baz = "Check"; + +$foo->bar = $bar; + +var_dump($bar->baz); +var_dump($foo->bar->baz); + +?> +===DONE=== +--EXPECTF-- +string(5) "Check" +string(5) "Check" +===DONE=== diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt new file mode 100644 index 0000000..d8bbad3 --- /dev/null +++ b/tests/classes/__set__get_005.phpt @@ -0,0 +1,68 @@ +--TEST-- +ZE2 __set() and __get() +--SKIPIF-- + +--FILE-- +x[$name])) { + return $this->x[$name]; + } + else + { + return NULL; + } + } + + function __set($name, $val) { + echo __METHOD__ . "\n"; + $this->x[$name] = $val; + } +} + +class AutoGen +{ + protected $x; + + function __get($name) { + echo __METHOD__ . "\n"; + if (!isset($this->x[$name])) { + $this->x[$name] = new Test(); + } + return $this->x[$name]; + } + + function __set($name, $val) { + echo __METHOD__ . "\n"; + $this->x[$name] = $val; + } +} + +$foo = new AutoGen(); +$foo->bar->baz = "Check"; + +var_dump($foo->bar); +var_dump($foo->bar->baz); + +?> +===DONE=== +--EXPECTF-- +AutoGen::__get +Test::__set +AutoGen::__get +object(Test)#%d (1) { + ["x":protected]=> + array(1) { + ["baz"]=> + string(5) "Check" + } +} +AutoGen::__get +Test::__get +string(5) "Check" +===DONE=== diff --git a/tests/classes/__set_data_corrupt.phpt b/tests/classes/__set_data_corrupt.phpt new file mode 100644 index 0000000..6a52bd4 --- /dev/null +++ b/tests/classes/__set_data_corrupt.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 Data corruption in __set +--SKIPIF-- + +--FILE-- +null); + + function bar() { + echo $this->t ='f'; + } + function __get($prop) + { + return $this->pp[$prop]; + } + function __set($prop, $val) + { + echo "__set"; + $this->pp[$prop] = ''; + } +} +$f = new foo; +$f->bar(); +?> +--EXPECT-- +__setf diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt new file mode 100644 index 0000000..fbebf4d --- /dev/null +++ b/tests/classes/abstract.phpt @@ -0,0 +1,30 @@ +--TEST-- +ZE2 An abstract method may not be called +--SKIPIF-- + +--FILE-- +show(); +$t->error(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call to function show() + +Fatal error: Cannot call abstract method fail::show() in %s on line %d diff --git a/tests/classes/abstract_by_interface_001.phpt b/tests/classes/abstract_by_interface_001.phpt new file mode 100644 index 0000000..7565fdf --- /dev/null +++ b/tests/classes/abstract_by_interface_001.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 An abstract method may not be called +--FILE-- + +===DONE=== +--EXPECTF-- +object(Leaf)#%d (0) { +} + +Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d diff --git a/tests/classes/abstract_by_interface_002.phpt b/tests/classes/abstract_by_interface_002.phpt new file mode 100644 index 0000000..77c5619 --- /dev/null +++ b/tests/classes/abstract_by_interface_002.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 An abstract method may not be called +--FILE-- + +===DONE=== +--EXPECTF-- +object(Leaf)#%d (0) { +} + +Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php on line %d diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt new file mode 100644 index 0000000..571a9b9 --- /dev/null +++ b/tests/classes/abstract_class.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 An abstract class cannot be instantiated +--SKIPIF-- + +--FILE-- +show(); + +$t = new fail(); +$t->show(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call to function show() + +Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_derived.phpt b/tests/classes/abstract_derived.phpt new file mode 100644 index 0000000..0feceac --- /dev/null +++ b/tests/classes/abstract_derived.phpt @@ -0,0 +1,20 @@ +--TEST-- +ZE2 A derived class with an abstract method must be abstract +--SKIPIF-- + +--FILE-- + +===DONE=== + +--EXPECTF-- + +Fatal error: Class derived contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (derived::show) in %sabstract_derived.php on line %d diff --git a/tests/classes/abstract_final.phpt b/tests/classes/abstract_final.phpt new file mode 100644 index 0000000..20c7ae3 --- /dev/null +++ b/tests/classes/abstract_final.phpt @@ -0,0 +1,16 @@ +--TEST-- +ZE2 A final method cannot be abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/abstract_inherit.phpt b/tests/classes/abstract_inherit.phpt new file mode 100644 index 0000000..362ccb0 --- /dev/null +++ b/tests/classes/abstract_inherit.phpt @@ -0,0 +1,22 @@ +--TEST-- +ZE2 A class that inherits an abstract method is abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot instantiate abstract class fail in %s on line %d diff --git a/tests/classes/abstract_not_declared.phpt b/tests/classes/abstract_not_declared.phpt new file mode 100644 index 0000000..3b81cd4 --- /dev/null +++ b/tests/classes/abstract_not_declared.phpt @@ -0,0 +1,15 @@ +--TEST-- +ZE2 An abstract class must be declared abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %s on line %d diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt new file mode 100644 index 0000000..9a0a1ed --- /dev/null +++ b/tests/classes/abstract_redeclare.phpt @@ -0,0 +1,22 @@ +--TEST-- +ZE2 A method cannot be redeclared abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %sabstract_redeclare.php on line %d diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt new file mode 100644 index 0000000..bcebec5 --- /dev/null +++ b/tests/classes/abstract_static.phpt @@ -0,0 +1,36 @@ +--TEST-- +ZE2 A static abstract methods +--FILE-- + +--EXPECTF-- +Call to function show() + +Strict Standards: Static function fail::func() should not be abstract in %sabstract_static.php(%d) : eval()'d code on line %d + +Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::func) in %sabstract_static.php(%d) : eval()'d code on line %d diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt new file mode 100644 index 0000000..0e1ddbe --- /dev/null +++ b/tests/classes/abstract_user_call.phpt @@ -0,0 +1,30 @@ +--TEST-- +ZE2 An abstrcat method cannot be called indirectly +--FILE-- +func(); + +call_user_func(array($o, 'test_base::func')); + +?> +===DONE=== +--EXPECTF-- +test::func() + +Fatal error: Cannot call abstract method test_base::func() in %s on line %d diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt new file mode 100644 index 0000000..feed3fb --- /dev/null +++ b/tests/classes/array_access_001.phpt @@ -0,0 +1,198 @@ +--TEST-- +ZE2 ArrayAccess +--FILE-- +'3rd', '4th'=>4); + + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } +} + +$obj = new Object; + +var_dump($obj->a); + +echo "===EMPTY===\n"; +var_dump(empty($obj[0])); +var_dump(empty($obj[1])); +var_dump(empty($obj[2])); +var_dump(empty($obj['4th'])); +var_dump(empty($obj['5th'])); +var_dump(empty($obj[6])); + +echo "===isset===\n"; +var_dump(isset($obj[0])); +var_dump(isset($obj[1])); +var_dump(isset($obj[2])); +var_dump(isset($obj['4th'])); +var_dump(isset($obj['5th'])); +var_dump(isset($obj[6])); + +echo "===offsetGet===\n"; +var_dump($obj[0]); +var_dump($obj[1]); +var_dump($obj[2]); +var_dump($obj['4th']); +var_dump($obj['5th']); +var_dump($obj[6]); + +echo "===offsetSet===\n"; +echo "WRITE 1\n"; +$obj[1] = 'Changed 1'; +var_dump($obj[1]); +echo "WRITE 2\n"; +$obj['4th'] = 'Changed 4th'; +var_dump($obj['4th']); +echo "WRITE 3\n"; +$obj['5th'] = 'Added 5th'; +var_dump($obj['5th']); +echo "WRITE 4\n"; +$obj[6] = 'Added 6'; +var_dump($obj[6]); + +var_dump($obj[0]); +var_dump($obj[2]); + +$x = $obj[6] = 'changed 6'; +var_dump($obj[6]); +var_dump($x); + +echo "===unset===\n"; +var_dump($obj->a); +unset($obj[2]); +unset($obj['4th']); +unset($obj[7]); +unset($obj['8th']); +var_dump($obj->a); + +?> +===DONE=== +--EXPECTF-- +array(4) { + [0]=> + string(3) "1st" + [1]=> + int(1) + [2]=> + string(3) "3rd" + ["4th"]=> + int(4) +} +===EMPTY=== +object::offsetExists(0) +object::offsetGet(0) +bool(false) +object::offsetExists(1) +object::offsetGet(1) +bool(false) +object::offsetExists(2) +object::offsetGet(2) +bool(false) +object::offsetExists(4th) +object::offsetGet(4th) +bool(false) +object::offsetExists(5th) +bool(true) +object::offsetExists(6) +bool(true) +===isset=== +object::offsetExists(0) +bool(true) +object::offsetExists(1) +bool(true) +object::offsetExists(2) +bool(true) +object::offsetExists(4th) +bool(true) +object::offsetExists(5th) +bool(false) +object::offsetExists(6) +bool(false) +===offsetGet=== +object::offsetGet(0) +string(3) "1st" +object::offsetGet(1) +int(1) +object::offsetGet(2) +string(3) "3rd" +object::offsetGet(4th) +int(4) +object::offsetGet(5th) + +Notice: Undefined index: 5th in %sarray_access_001.php on line %d +NULL +object::offsetGet(6) + +Notice: Undefined offset: 6 in %sarray_access_001.php on line %d +NULL +===offsetSet=== +WRITE 1 +object::offsetSet(1,Changed 1) +object::offsetGet(1) +string(9) "Changed 1" +WRITE 2 +object::offsetSet(4th,Changed 4th) +object::offsetGet(4th) +string(11) "Changed 4th" +WRITE 3 +object::offsetSet(5th,Added 5th) +object::offsetGet(5th) +string(9) "Added 5th" +WRITE 4 +object::offsetSet(6,Added 6) +object::offsetGet(6) +string(7) "Added 6" +object::offsetGet(0) +string(3) "1st" +object::offsetGet(2) +string(3) "3rd" +object::offsetSet(6,changed 6) +object::offsetGet(6) +string(9) "changed 6" +string(9) "changed 6" +===unset=== +array(6) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + [2]=> + string(3) "3rd" + ["4th"]=> + string(11) "Changed 4th" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +object::offsetUnset(2) +object::offsetUnset(4th) +object::offsetUnset(7) +object::offsetUnset(8th) +array(4) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +===DONE=== diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt new file mode 100644 index 0000000..68640c8 --- /dev/null +++ b/tests/classes/array_access_002.phpt @@ -0,0 +1,198 @@ +--TEST-- +ZE2 ArrayAccess::offsetSet without return +--FILE-- +'3rd', '4th'=>4); + + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + /*return*/ $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } +} + +$obj = new Object; + +var_dump($obj->a); + +echo "===EMPTY===\n"; +var_dump(empty($obj[0])); +var_dump(empty($obj[1])); +var_dump(empty($obj[2])); +var_dump(empty($obj['4th'])); +var_dump(empty($obj['5th'])); +var_dump(empty($obj[6])); + +echo "===isset===\n"; +var_dump(isset($obj[0])); +var_dump(isset($obj[1])); +var_dump(isset($obj[2])); +var_dump(isset($obj['4th'])); +var_dump(isset($obj['5th'])); +var_dump(isset($obj[6])); + +echo "===offsetGet===\n"; +var_dump($obj[0]); +var_dump($obj[1]); +var_dump($obj[2]); +var_dump($obj['4th']); +var_dump($obj['5th']); +var_dump($obj[6]); + +echo "===offsetSet===\n"; +echo "WRITE 1\n"; +$obj[1] = 'Changed 1'; +var_dump($obj[1]); +echo "WRITE 2\n"; +$obj['4th'] = 'Changed 4th'; +var_dump($obj['4th']); +echo "WRITE 3\n"; +$obj['5th'] = 'Added 5th'; +var_dump($obj['5th']); +echo "WRITE 4\n"; +$obj[6] = 'Added 6'; +var_dump($obj[6]); + +var_dump($obj[0]); +var_dump($obj[2]); + +$x = $obj[6] = 'changed 6'; +var_dump($obj[6]); +var_dump($x); + +echo "===unset===\n"; +var_dump($obj->a); +unset($obj[2]); +unset($obj['4th']); +unset($obj[7]); +unset($obj['8th']); +var_dump($obj->a); + +?> +===DONE=== +--EXPECTF-- +array(4) { + [0]=> + string(3) "1st" + [1]=> + int(1) + [2]=> + string(3) "3rd" + ["4th"]=> + int(4) +} +===EMPTY=== +object::offsetExists(0) +object::offsetGet(0) +bool(false) +object::offsetExists(1) +object::offsetGet(1) +bool(false) +object::offsetExists(2) +object::offsetGet(2) +bool(false) +object::offsetExists(4th) +object::offsetGet(4th) +bool(false) +object::offsetExists(5th) +bool(true) +object::offsetExists(6) +bool(true) +===isset=== +object::offsetExists(0) +bool(true) +object::offsetExists(1) +bool(true) +object::offsetExists(2) +bool(true) +object::offsetExists(4th) +bool(true) +object::offsetExists(5th) +bool(false) +object::offsetExists(6) +bool(false) +===offsetGet=== +object::offsetGet(0) +string(3) "1st" +object::offsetGet(1) +int(1) +object::offsetGet(2) +string(3) "3rd" +object::offsetGet(4th) +int(4) +object::offsetGet(5th) + +Notice: Undefined index: 5th in %sarray_access_002.php on line %d +NULL +object::offsetGet(6) + +Notice: Undefined offset: 6 in %sarray_access_002.php on line %d +NULL +===offsetSet=== +WRITE 1 +object::offsetSet(1,Changed 1) +object::offsetGet(1) +string(9) "Changed 1" +WRITE 2 +object::offsetSet(4th,Changed 4th) +object::offsetGet(4th) +string(11) "Changed 4th" +WRITE 3 +object::offsetSet(5th,Added 5th) +object::offsetGet(5th) +string(9) "Added 5th" +WRITE 4 +object::offsetSet(6,Added 6) +object::offsetGet(6) +string(7) "Added 6" +object::offsetGet(0) +string(3) "1st" +object::offsetGet(2) +string(3) "3rd" +object::offsetSet(6,changed 6) +object::offsetGet(6) +string(9) "changed 6" +string(9) "changed 6" +===unset=== +array(6) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + [2]=> + string(3) "3rd" + ["4th"]=> + string(11) "Changed 4th" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +object::offsetUnset(2) +object::offsetUnset(4th) +object::offsetUnset(7) +object::offsetUnset(8th) +array(4) { + [0]=> + string(3) "1st" + [1]=> + string(9) "Changed 1" + ["5th"]=> + string(9) "Added 5th" + [6]=> + string(9) "changed 6" +} +===DONE=== diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt new file mode 100644 index 0000000..3e63112 --- /dev/null +++ b/tests/classes/array_access_003.phpt @@ -0,0 +1,59 @@ +--TEST-- +ZE2 ArrayAccess::offsetGet ambiguties +--INI-- +error_reporting=4095 +--FILE-- +'3rd', '4th'=>4); + + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + switch($index) { + case 1: + $a = 'foo'; + return $a . 'Bar'; + case 2: + static $a=1; + return $a; + } + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + if ($index==3) { + $this->cnt = $newval; + } + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } +} + +$obj = new Object; + +var_dump($obj[1]); +var_dump($obj[2]); +$obj[2]++; +var_dump($obj[2]); + +?> +===DONE=== +--EXPECTF-- +object::offsetGet(1) +string(6) "fooBar" +object::offsetGet(2) +int(1) +object::offsetGet(2) + +Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_003.php on line 39 +object::offsetGet(2) +int(1) +===DONE=== diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt new file mode 100644 index 0000000..7874967 --- /dev/null +++ b/tests/classes/array_access_004.phpt @@ -0,0 +1,57 @@ +--TEST-- +ZE2 ArrayAccess::offsetGet ambiguties +--FILE-- +'3rd', '4th'=>4); + + function offsetExists($index) { + echo __METHOD__ . "($index)\n"; + return array_key_exists($index, $this->a); + } + function offsetGet($index) { + echo __METHOD__ . "($index)\n"; + switch($index) { + case 1: + $a = 'foo'; + return $a . 'Bar'; + case 2: + static $a=1; + return $a; + } + return $this->a[$index]; + } + function offsetSet($index, $newval) { + echo __METHOD__ . "($index,$newval)\n"; + if ($index==3) { + $this->cnt = $newval; + } + return $this->a[$index] = $newval; + } + function offsetUnset($index) { + echo __METHOD__ . "($index)\n"; + unset($this->a[$index]); + } +} + +$obj = new Object; + +var_dump($obj[1]); +var_dump($obj[2]); +$obj[2]++; +var_dump($obj[2]); + +?> +===DONE=== +--EXPECTF-- +object::offsetGet(1) +string(6) "fooBar" +object::offsetGet(2) +int(1) +object::offsetGet(2) + +Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_004.php on line 39 +object::offsetGet(2) +int(1) +===DONE=== diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt new file mode 100644 index 0000000..dcb873f --- /dev/null +++ b/tests/classes/array_access_005.phpt @@ -0,0 +1,77 @@ +--TEST-- +ZE2 ArrayAccess and sub Arrays +--FILE-- +person = array(array('name'=>'Joe')); + } + + function offsetExists($index) { + return array_key_exists($this->person, $index); + } + + function offsetGet($index) { + return $this->person[$index]; + } + + function offsetSet($index, $value) { + $this->person[$index] = $value; + } + + function offsetUnset($index) { + unset($this->person[$index]); + } +} + +$people = new Peoples; + +var_dump($people->person[0]['name']); +$people->person[0]['name'] = $people->person[0]['name'] . 'Foo'; +var_dump($people->person[0]['name']); +$people->person[0]['name'] .= 'Bar'; +var_dump($people->person[0]['name']); + +echo "---ArrayOverloading---\n"; + +$people = new Peoples; + +var_dump($people[0]); +var_dump($people[0]['name']); +var_dump($people->person[0]['name'] . 'Foo'); // impossible to assign this since we don't return references here +$x = $people[0]; // creates a copy +$x['name'] .= 'Foo'; +$people[0] = $x; +var_dump($people[0]); +$people[0]['name'] = 'JoeFoo'; +var_dump($people[0]['name']); +$people[0]['name'] = 'JoeFooBar'; +var_dump($people[0]['name']); + +?> +===DONE=== +--EXPECTF-- +string(3) "Joe" +string(6) "JoeFoo" +string(9) "JoeFooBar" +---ArrayOverloading--- +array(1) { + ["name"]=> + string(3) "Joe" +} +string(3) "Joe" +string(6) "JoeFoo" +array(1) { + ["name"]=> + string(6) "JoeFoo" +} + +Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 46 +string(6) "JoeFoo" + +Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 48 +string(6) "JoeFoo" +===DONE=== diff --git a/tests/classes/array_access_006.phpt b/tests/classes/array_access_006.phpt new file mode 100644 index 0000000..342a7e5 --- /dev/null +++ b/tests/classes/array_access_006.phpt @@ -0,0 +1,37 @@ +--TEST-- +ZE2 ArrayAccess and ASSIGN_OP operators (+=) +--FILE-- +realArray = array(1,2,3); + } + + function offsetExists($index) { + return array_key_exists($this->realArray, $index); + } + + function offsetGet($index) { + return $this->realArray[$index]; + } + + function offsetSet($index, $value) { + $this->realArray[$index] = $value; + } + + function offsetUnset($index) { + unset($this->realArray[$index]); + } +} + +$a = new OverloadedArray; +$a[1] += 10; +var_dump($a[1]); +echo "---Done---\n"; +?> +--EXPECT-- +int(12) +---Done--- diff --git a/tests/classes/array_access_007.phpt b/tests/classes/array_access_007.phpt new file mode 100644 index 0000000..42187fe --- /dev/null +++ b/tests/classes/array_access_007.phpt @@ -0,0 +1,57 @@ +--TEST-- +ZE2 ArrayAccess and [] assignment +--FILE-- +realArray = array(); + } + + function offsetExists($index) { + return array_key_exists($this->realArray, $index); + } + + function offsetGet($index) { + return $this->realArray[$index]; + } + + function offsetSet($index, $value) { + if (is_null($index)) { + $this->realArray[] = $value; + } else { + $this->realArray[$index] = $value; + } + } + + function offsetUnset($index) { + unset($this->realArray[$index]); + } + + function dump() { + var_dump($this->realArray); + } +} + +$a = new OverloadedArray; +$a[] = 1; +$a[1] = 2; +$a[2] = 3; +$a[] = 4; +$a->dump(); +?> +===DONE=== +--EXPECT-- +array(4) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) +} +===DONE=== diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt new file mode 100644 index 0000000..9979889 --- /dev/null +++ b/tests/classes/array_access_008.phpt @@ -0,0 +1,67 @@ +--TEST-- +ZE2 ArrayAccess and ASSIGN_OP operators (.=) +--FILE-- +person = array(array('name'=>'Foo')); + } + + function offsetExists($index) { + return array_key_exists($this->person, $index); + } + + function offsetGet($index) { + return $this->person[$index]; + } + + function offsetSet($index, $value) { + $this->person[$index] = $value; + } + + function offsetUnset($index) { + unset($this->person[$index]); + } +} + +$people = new Peoples; + +var_dump($people->person[0]['name']); +$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people->person[0]['name']); +$people->person[0]['name'] .= 'Baz'; +var_dump($people->person[0]['name']); + +echo "===ArrayOverloading===\n"; + +$people = new Peoples; + +var_dump($people[0]['name']); +$people[0]['name'] = 'FooBar'; +var_dump($people[0]['name']); +$people[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people[0]['name']); +$people[0]['name'] .= 'Baz'; +var_dump($people[0]['name']); + +?> +===DONE=== +--EXPECTF-- +string(3) "Foo" +string(6) "FooBar" +string(9) "FooBarBaz" +===ArrayOverloading=== +string(3) "Foo" + +Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 40 +string(3) "Foo" + +Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 42 +string(3) "Foo" + +Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 44 +string(3) "Foo" +===DONE=== diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt new file mode 100644 index 0000000..3862240 --- /dev/null +++ b/tests/classes/array_access_009.phpt @@ -0,0 +1,190 @@ +--TEST-- +ZE2 ArrayAccess and ArrayProxyAccess, ArrayProxy +--FILE-- +offsetExists($element)) + { + $object[$element] = array(); + } + $this->object = $object; + $this->element = $element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->object->proxyGet($this->element)); + } + + function offsetGet($index) { + echo __METHOD__ . "($this->element, $index)\n"; + $tmp = $this->object->proxyGet($this->element); + return isset($tmp[$index]) ? $tmp[$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "($this->element, $index, $value)\n"; + $this->object->proxySet($this->element, $index, $value); + } + + function offsetUnset($index) { + echo __METHOD__ . "($this->element, $index)\n"; + $this->object->proxyUnset($this->element, $index); + } +} + +class Peoples implements ArrayProxyAccess +{ + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + return new ArrayProxy($this, $index); + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } + + function proxyGet($element) + { + return $this->person[$element]; + } + + function proxySet($element, $index, $value) + { + $this->person[$element][$index] = $value; + } + + function proxyUnset($element, $index) + { + unset($this->person[$element][$index]); + } +} + +$people = new Peoples; + +var_dump($people->person[0]['name']); +$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people->person[0]['name']); +$people->person[0]['name'] .= 'Baz'; +var_dump($people->person[0]['name']); + +echo "===ArrayOverloading===\n"; + +$people = new Peoples; + +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'FooBar'; +var_dump($people[0]['name']); +$people[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people[0]['name']); +$people[0]['name'] .= 'Baz'; +var_dump($people[0]['name']); +unset($people[0]['name']); +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'BlaBla'; +var_dump($people[0]['name']); + +?> +===DONE=== +--EXPECTF-- +string(3) "Foo" +string(6) "FooBar" +string(9) "FooBarBaz" +===ArrayOverloading=== +ArrayProxy::__construct(0) +object(ArrayProxy)#%d (2) { + ["object":"ArrayProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + array(1) { + [0]=> + array(1) { + ["name"]=> + string(3) "Foo" + } + } + } + ["element":"ArrayProxy":private]=> + int(0) +} +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +string(3) "Foo" +ArrayProxy::__construct(0) +ArrayProxy::offsetSet(0, name, FooBar) +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +string(6) "FooBar" +ArrayProxy::__construct(0) +ArrayProxy::offsetSet(0, name, FooBarBar) +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +string(9) "FooBarBar" +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +ArrayProxy::offsetSet(0, name, FooBarBarBaz) +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +string(12) "FooBarBarBaz" +ArrayProxy::__construct(0) +ArrayProxy::offsetUnset(0, name) +ArrayProxy::__construct(0) +object(ArrayProxy)#%d (2) { + ["object":"ArrayProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + array(1) { + [0]=> + array(0) { + } + } + } + ["element":"ArrayProxy":private]=> + int(0) +} +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +NULL +ArrayProxy::__construct(0) +ArrayProxy::offsetSet(0, name, BlaBla) +ArrayProxy::__construct(0) +ArrayProxy::offsetGet(0, name) +string(6) "BlaBla" +===DONE=== diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt new file mode 100644 index 0000000..ad374d2 --- /dev/null +++ b/tests/classes/array_access_010.phpt @@ -0,0 +1,168 @@ +--TEST-- +ZE2 ArrayAccess and ArrayReferenceProxy with references +--FILE-- +object = $object; + $this->element = &$element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->element); + } + + function offsetGet($index) { + echo __METHOD__ . "(Array, $index)\n"; + return isset($this->element[$index]) ? $this->element[$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "(Array, $index, $value)\n"; + $this->element[$index] = $value; + } + + function offsetUnset($index) { + echo __METHOD__ . "(Array, $index)\n"; + unset($this->element[$index]); + } +} + +class Peoples implements ArrayAccess +{ + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + return new ArrayReferenceProxy($this, $this->person[$index]); + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } +} + +$people = new Peoples; + +var_dump($people->person[0]['name']); +$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people->person[0]['name']); +$people->person[0]['name'] .= 'Baz'; +var_dump($people->person[0]['name']); + +echo "===ArrayOverloading===\n"; + +$people = new Peoples; + +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'FooBar'; +var_dump($people[0]['name']); +$people[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people[0]['name']); +$people[0]['name'] .= 'Baz'; +var_dump($people[0]['name']); +unset($people[0]['name']); +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'BlaBla'; +var_dump($people[0]['name']); + +?> +===DONE=== + +--EXPECTF-- +string(3) "Foo" +string(6) "FooBar" +string(9) "FooBarBaz" +===ArrayOverloading=== +ArrayReferenceProxy::__construct(Array) +object(ArrayReferenceProxy)#%d (2) { + ["object":"ArrayReferenceProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + array(1) { + [0]=> + &array(1) { + ["name"]=> + string(3) "Foo" + } + } + } + ["element":"ArrayReferenceProxy":private]=> + &array(1) { + ["name"]=> + string(3) "Foo" + } +} +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +string(3) "Foo" +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetSet(Array, name, FooBar) +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +string(6) "FooBar" +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetSet(Array, name, FooBarBar) +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +string(9) "FooBarBar" +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +ArrayReferenceProxy::offsetSet(Array, name, FooBarBarBaz) +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +string(12) "FooBarBarBaz" +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetUnset(Array, name) +ArrayReferenceProxy::__construct(Array) +object(ArrayReferenceProxy)#%d (2) { + ["object":"ArrayReferenceProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + array(1) { + [0]=> + &array(0) { + } + } + } + ["element":"ArrayReferenceProxy":private]=> + &array(0) { + } +} +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +NULL +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetSet(Array, name, BlaBla) +ArrayReferenceProxy::__construct(Array) +ArrayReferenceProxy::offsetGet(Array, name) +string(6) "BlaBla" +===DONE=== diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt new file mode 100644 index 0000000..aa20a56 --- /dev/null +++ b/tests/classes/array_access_011.phpt @@ -0,0 +1,187 @@ +--TEST-- +ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main array +--FILE-- +object = $object; + $this->oarray = &$array; + $this->element = $element; + } + + function offsetExists($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return array_key_exists($index, $this->oarray[$this->element]); + } + + function offsetGet($index) { + echo __METHOD__ . "($this->element, $index)\n"; + return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL; + } + + function offsetSet($index, $value) { + echo __METHOD__ . "($this->element, $index, $value)\n"; + $this->oarray[$this->element][$index] = $value; + } + + function offsetUnset($index) { + echo __METHOD__ . "($this->element, $index)\n"; + unset($this->oarray[$this->element][$index]); + } +} + +class Peoples implements ArrayAccess +{ + public $person; + + function __construct() + { + $this->person = array(array('name'=>'Foo')); + } + + function offsetExists($index) + { + return array_key_exists($index, $this->person); + } + + function offsetGet($index) + { + if (is_array($this->person[$index])) + { + return new ArrayAccessReferenceProxy($this, $this->person, $index); + } + else + { + return $this->person[$index]; + } + } + + function offsetSet($index, $value) + { + $this->person[$index] = $value; + } + + function offsetUnset($index) + { + unset($this->person[$index]); + } +} + +$people = new Peoples; + +var_dump($people->person[0]['name']); +$people->person[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people->person[0]['name']); +$people->person[0]['name'] .= 'Baz'; +var_dump($people->person[0]['name']); + +echo "===ArrayOverloading===\n"; + +$people = new Peoples; + +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'FooBar'; +var_dump($people[0]['name']); +$people[0]['name'] = $people->person[0]['name'] . 'Bar'; +var_dump($people[0]['name']); +$people[0]['name'] .= 'Baz'; +var_dump($people[0]['name']); +unset($people[0]['name']); +var_dump($people[0]); +var_dump($people[0]['name']); +$people[0]['name'] = 'BlaBla'; +var_dump($people[0]['name']); + +?> +===DONE=== + +--EXPECTF-- +string(3) "Foo" +string(6) "FooBar" +string(9) "FooBarBaz" +===ArrayOverloading=== +ArrayAccessReferenceProxy::__construct(0) +object(ArrayAccessReferenceProxy)#%d (3) { + ["object":"ArrayAccessReferenceProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + &array(1) { + [0]=> + array(1) { + ["name"]=> + string(3) "Foo" + } + } + } + ["oarray":"ArrayAccessReferenceProxy":private]=> + &array(1) { + [0]=> + array(1) { + ["name"]=> + string(3) "Foo" + } + } + ["element":"ArrayAccessReferenceProxy":private]=> + int(0) +} +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +string(3) "Foo" +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetSet(0, name, FooBar) +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +string(6) "FooBar" +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBar) +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +string(9) "FooBarBar" +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBarBaz) +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +string(12) "FooBarBarBaz" +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetUnset(0, name) +ArrayAccessReferenceProxy::__construct(0) +object(ArrayAccessReferenceProxy)#%d (3) { + ["object":"ArrayAccessReferenceProxy":private]=> + object(Peoples)#%d (1) { + ["person"]=> + &array(1) { + [0]=> + array(0) { + } + } + } + ["oarray":"ArrayAccessReferenceProxy":private]=> + &array(1) { + [0]=> + array(0) { + } + } + ["element":"ArrayAccessReferenceProxy":private]=> + int(0) +} +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +NULL +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla) +ArrayAccessReferenceProxy::__construct(0) +ArrayAccessReferenceProxy::offsetGet(0, name) +string(6) "BlaBla" +===DONE=== diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt new file mode 100644 index 0000000..8f85f29 --- /dev/null +++ b/tests/classes/array_access_012.phpt @@ -0,0 +1,36 @@ +--TEST-- +ZE2 ArrayAccess cannot assign by reference +--FILE-- +data[$index] = $value; + } + + public function offsetGet($index) { + return $this->data[$index]; + } + + public function offsetExists($index) { + return isset($this->data[$index]); + } +} + +$data = new ArrayAccessImpl(); +$test = 'some data'; +$data['element'] = NULL; // prevent notice +$data['element'] = &$test; + +?> +===DONE=== + +--EXPECTF-- + +Notice: Indirect modification of overloaded element of ArrayAccessImpl has no effect in %sarray_access_012.php on line 24 + +Fatal error: Cannot assign by reference to overloaded object in %sarray_access_012.php on line 24 diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt new file mode 100644 index 0000000..206d9d5 --- /dev/null +++ b/tests/classes/array_access_013.phpt @@ -0,0 +1,58 @@ +--TEST-- +ZE2 ArrayAccess and exceptions +--FILE-- +getMessage() . "()\n"; +} + +try +{ + echo $t[0]; +} +catch(Exception $e) +{ + echo "Caught in " . $e->getMessage() . "()\n"; +} + +try +{ + $t[0] = 1; +} +catch(Exception $e) +{ + echo "Caught in " . $e->getMessage() . "()\n"; +} + +try +{ + unset($t[0]); +} +catch(Exception $e) +{ + echo "Caught in " . $e->getMessage() . "()\n"; +} +?> +===DONE=== +--EXPECT-- +Caught in Test::offsetExists() +Caught in Test::offsetGet() +Caught in Test::offsetSet() +Caught in Test::offsetUnset() +===DONE=== diff --git a/tests/classes/arrayobject_001.phpt b/tests/classes/arrayobject_001.phpt new file mode 100644 index 0000000..b75f8c7 --- /dev/null +++ b/tests/classes/arrayobject_001.phpt @@ -0,0 +1,13 @@ +--TEST-- +Ensure that ArrayObject acts like an array +--FILE-- + +--EXPECT-- +bar1bar diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt new file mode 100644 index 0000000..21e131c --- /dev/null +++ b/tests/classes/assign_op_property_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 assign_op property of overloaded object +--FILE-- +real_a = $value; + } + } + + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } +} + +$obj = new Test; +var_dump($obj->a); +$obj->a += 2; +var_dump($obj->a); +echo "---Done---\n"; +?> +--EXPECT-- +int(2) +int(4) +---Done--- diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt new file mode 100644 index 0000000..6f325f4 --- /dev/null +++ b/tests/classes/autoload_001.phpt @@ -0,0 +1,24 @@ +--TEST-- +ZE2 Autoload and class_exists +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +__autoload(autoload_root) +bool(true) +===DONE=== diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt new file mode 100644 index 0000000..27dea0f --- /dev/null +++ b/tests/classes/autoload_002.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 Autoload and get_class_methods +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +__autoload(autoload_root) +array(1) { + [0]=> + string(12) "testFunction" +} +===DONE=== diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt new file mode 100644 index 0000000..7bdb5da --- /dev/null +++ b/tests/classes/autoload_003.phpt @@ -0,0 +1,25 @@ +--TEST-- +ZE2 Autoload and derived classes +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +__autoload(autoload_root) +__autoload(autoload_derived) +bool(true) +===DONE=== diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt new file mode 100644 index 0000000..23aea5d --- /dev/null +++ b/tests/classes/autoload_004.phpt @@ -0,0 +1,28 @@ +--TEST-- +ZE2 Autoload and recursion +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(false) +bool(false) +__autoload(autoload_root) +__autoload(autoload_derived) +bool(true) +===DONE=== diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt new file mode 100644 index 0000000..36a4e18 --- /dev/null +++ b/tests/classes/autoload_005.phpt @@ -0,0 +1,45 @@ +--TEST-- +ZE2 Autoload from destructor +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(false) +bool(false) +Test::__destruct +bool(false) +bool(false) +__autoload(autoload_root) +__autoload(autoload_derived) +object(autoload_derived)#%d (0) { +} +===DONE=== diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt new file mode 100644 index 0000000..9af6fc9 --- /dev/null +++ b/tests/classes/autoload_006.phpt @@ -0,0 +1,40 @@ +--TEST-- +ZE2 Autoload from destructor +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(false) +bool(false) +__autoload(autoload_interface) +__autoload(Autoload_Implements) +object(autoload_implements)#%d (0) { +} +bool(true) +bool(true) +bool(true) +===DONE=== diff --git a/tests/classes/autoload_007.phpt b/tests/classes/autoload_007.phpt new file mode 100644 index 0000000..5652c12 --- /dev/null +++ b/tests/classes/autoload_007.phpt @@ -0,0 +1,15 @@ +--TEST-- +Ensure instanceof does not trigger autoload. +--FILE-- + +--EXPECTF-- +bool(false) diff --git a/tests/classes/autoload_008.phpt b/tests/classes/autoload_008.phpt new file mode 100644 index 0000000..75a9cd0 --- /dev/null +++ b/tests/classes/autoload_008.phpt @@ -0,0 +1,26 @@ +--TEST-- +Ensure catch blocks for unknown exception types do not trigger autoload. +--FILE-- + +--EXPECTF-- +In Exception catch block. Autoload should not have been triggered. diff --git a/tests/classes/autoload_009.phpt b/tests/classes/autoload_009.phpt new file mode 100644 index 0000000..46f6055 --- /dev/null +++ b/tests/classes/autoload_009.phpt @@ -0,0 +1,20 @@ +--TEST-- +Ensure type hints for unknown types do not trigger autoload. +--FILE-- + +--EXPECTF-- + +Catchable fatal error: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s + + diff --git a/tests/classes/autoload_010.phpt b/tests/classes/autoload_010.phpt new file mode 100644 index 0000000..104f688 --- /dev/null +++ b/tests/classes/autoload_010.phpt @@ -0,0 +1,18 @@ +--TEST-- +Ensure implements does trigger autoload. +--FILE-- + +--EXPECTF-- +In autoload: string(6) "UndefI" + +Fatal error: Interface 'UndefI' not found in %s on line %d diff --git a/tests/classes/autoload_011.phpt b/tests/classes/autoload_011.phpt new file mode 100644 index 0000000..86858d5 --- /dev/null +++ b/tests/classes/autoload_011.phpt @@ -0,0 +1,18 @@ +--TEST-- +Ensure extends does trigger autoload. +--FILE-- + +--EXPECTF-- +In autoload: string(9) "UndefBase" + +Fatal error: Class 'UndefBase' not found in %s on line %d diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt new file mode 100644 index 0000000..d6750b7 --- /dev/null +++ b/tests/classes/autoload_012.phpt @@ -0,0 +1,15 @@ +--TEST-- +Ensure callback methods in unknown classes trigger autoload. +--FILE-- + +--EXPECTF-- +In autoload: string(6) "UndefC" + +Warning: call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found in %s on line %d diff --git a/tests/classes/autoload_013.phpt b/tests/classes/autoload_013.phpt new file mode 100644 index 0000000..4309cea --- /dev/null +++ b/tests/classes/autoload_013.phpt @@ -0,0 +1,22 @@ +--TEST-- +Ensure the ReflectionClass constructor triggers autoload. +--SKIPIF-- + +--FILE-- +getMessage(); + } +?> +--EXPECTF-- +In autoload: string(6) "UndefC" +Class UndefC does not exist diff --git a/tests/classes/autoload_014.phpt b/tests/classes/autoload_014.phpt new file mode 100644 index 0000000..a3f04b7 --- /dev/null +++ b/tests/classes/autoload_014.phpt @@ -0,0 +1,22 @@ +--TEST-- +Ensure the ReflectionMethod constructor triggers autoload. +--SKIPIF-- + +--FILE-- +getMessage(); + } +?> +--EXPECTF-- +In autoload: string(6) "UndefC" +Class UndefC does not exist diff --git a/tests/classes/autoload_015.phpt b/tests/classes/autoload_015.phpt new file mode 100644 index 0000000..2b14a0d --- /dev/null +++ b/tests/classes/autoload_015.phpt @@ -0,0 +1,22 @@ +--TEST-- +Ensure the ReflectionProperty constructor triggers autoload. +--SKIPIF-- + +--FILE-- +getMessage(); + } +?> +--EXPECTF-- +In autoload: string(6) "UndefC" +Class UndefC does not exist diff --git a/tests/classes/autoload_016.phpt b/tests/classes/autoload_016.phpt new file mode 100644 index 0000000..60263ba --- /dev/null +++ b/tests/classes/autoload_016.phpt @@ -0,0 +1,23 @@ +--TEST-- +Ensure ReflectionClass::getProperty() triggers autoload +--SKIPIF-- + +--FILE-- +getProperty("UndefC::p"); + } catch (ReflectionException $e) { + echo $e->getMessage(); + } +?> +--EXPECTF-- +In autoload: string(6) "undefc" +Class undefc does not exist diff --git a/tests/classes/autoload_017.phpt b/tests/classes/autoload_017.phpt new file mode 100644 index 0000000..26de9fd --- /dev/null +++ b/tests/classes/autoload_017.phpt @@ -0,0 +1,23 @@ +--TEST-- +Ensure ReflectionClass::implementsInterface triggers autoload. +--SKIPIF-- + +--FILE-- +implementsInterface("UndefI"); + } catch (ReflectionException $e) { + echo $e->getMessage(); + } +?> +--EXPECTF-- +In autoload: string(6) "UndefI" +Interface UndefI does not exist \ No newline at end of file diff --git a/tests/classes/autoload_018.phpt b/tests/classes/autoload_018.phpt new file mode 100644 index 0000000..59e20e2 --- /dev/null +++ b/tests/classes/autoload_018.phpt @@ -0,0 +1,48 @@ +--TEST-- +Ensure __autoload() allows for recursive calls if the class name differs. +--FILE-- + 10) { + echo "-> Recursion detected - as expected.\n"; + return; + } + + class_exists('UndefinedClass' . $i); + + echo "OUT: " . __METHOD__ . "($name)\n"; + } + + var_dump(class_exists('UndefinedClass0')); +?> +--EXPECTF-- +IN: __autoload(UndefinedClass0) +IN: __autoload(UndefinedClass1) +IN: __autoload(UndefinedClass2) +IN: __autoload(UndefinedClass3) +IN: __autoload(UndefinedClass4) +IN: __autoload(UndefinedClass5) +IN: __autoload(UndefinedClass6) +IN: __autoload(UndefinedClass7) +IN: __autoload(UndefinedClass8) +IN: __autoload(UndefinedClass9) +IN: __autoload(UndefinedClass10) +IN: __autoload(UndefinedClass11) +-> Recursion detected - as expected. +OUT: __autoload(UndefinedClass10) +OUT: __autoload(UndefinedClass9) +OUT: __autoload(UndefinedClass8) +OUT: __autoload(UndefinedClass7) +OUT: __autoload(UndefinedClass6) +OUT: __autoload(UndefinedClass5) +OUT: __autoload(UndefinedClass4) +OUT: __autoload(UndefinedClass3) +OUT: __autoload(UndefinedClass2) +OUT: __autoload(UndefinedClass1) +OUT: __autoload(UndefinedClass0) +bool(false) + diff --git a/tests/classes/autoload_019.phpt b/tests/classes/autoload_019.phpt new file mode 100644 index 0000000..7836320 --- /dev/null +++ b/tests/classes/autoload_019.phpt @@ -0,0 +1,14 @@ +--TEST-- +Ensure __autoload() recursion is guarded for multiple lookups of same class using difference case. +--FILE-- + +--EXPECTF-- +__autoload unDefinedClass diff --git a/tests/classes/autoload_020.phpt b/tests/classes/autoload_020.phpt new file mode 100644 index 0000000..a88e561 --- /dev/null +++ b/tests/classes/autoload_020.phpt @@ -0,0 +1,17 @@ +--TEST-- +Ensure __autoload() is triggered during unserialization. +--FILE-- + +--EXPECTF-- +in autoload: C +object(__PHP_Incomplete_Class)#%d (1) { + ["__PHP_Incomplete_Class_Name"]=> + string(1) "C" +} diff --git a/tests/classes/autoload_derived.p5c b/tests/classes/autoload_derived.p5c new file mode 100755 index 0000000..93a4b35 --- /dev/null +++ b/tests/classes/autoload_derived.p5c @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c new file mode 100755 index 0000000..2c3479c --- /dev/null +++ b/tests/classes/autoload_implements.p5c @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c new file mode 100755 index 0000000..6908155 --- /dev/null +++ b/tests/classes/autoload_interface.p5c @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/tests/classes/autoload_root.p5c b/tests/classes/autoload_root.p5c new file mode 100755 index 0000000..9559d36 --- /dev/null +++ b/tests/classes/autoload_root.p5c @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/tests/classes/bug23951.phpt b/tests/classes/bug23951.phpt new file mode 100644 index 0000000..2e272b8 --- /dev/null +++ b/tests/classes/bug23951.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #23951 (Defines not working in inherited classes) +--FILE-- +'foo1_value', FOO2=>'foo2_value'); + +} + +class B extends A { + + public $b_var = 'foo'; + +} + +$a = new A; +$b = new B; + +print_r($a); +print_r($b->a_var); +print_r($b->b_var); + +?> +--EXPECT-- +A Object +( + [a_var] => Array + ( + [1] => foo1_value + [2] => foo2_value + ) + +) +Array +( + [1] => foo1_value + [2] => foo2_value +) +foo diff --git a/tests/classes/bug24399.phpt b/tests/classes/bug24399.phpt new file mode 100644 index 0000000..fedf8e5 --- /dev/null +++ b/tests/classes/bug24399.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #24399 (is_subclass_of() crashes when parent class doesn't exist) +--FILE-- + +--EXPECT-- +bool(false) diff --git a/tests/classes/bug24445.phpt b/tests/classes/bug24445.phpt new file mode 100644 index 0000000..af08307 --- /dev/null +++ b/tests/classes/bug24445.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #24445 (get_parent_class() returns the current class when passed an object) +--FILE-- + +--EXPECT-- +bool(false) +bool(false) diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt new file mode 100644 index 0000000..e190318 --- /dev/null +++ b/tests/classes/bug26737.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #26737 (Protected and private variables are not saved on serialization when a user defined __sleep is used) +--FILE-- + +--EXPECTF-- +Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d +string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}" diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt new file mode 100644 index 0000000..58a7b6c --- /dev/null +++ b/tests/classes/bug27468.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #27468 (foreach in __destruct() causes segfault) +--FILE-- +x as $x); + } +} +new foo(); +echo 'OK'; +?> +--EXPECTF-- +Notice: Undefined property: foo::$x in %sbug27468.php on line 4 + +Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4 +OK diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt new file mode 100644 index 0000000..5f2c5a0 --- /dev/null +++ b/tests/classes/bug27504.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #27504 (call_user_func_array allows calling of private/protected methods) +--FILE-- +bar('1'); + } + private function bar ( $param ) { + echo 'Called function foo:bar('.$param.')'."\n"; + } + } + + $foo = new foo(); + + call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); + + $foo->bar('3'); +?> +--EXPECTF-- +Called function foo:bar(1) + +Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar() in %s on line %d + +Fatal error: Call to private method foo::bar() from context '' in %s on line %d diff --git a/tests/classes/bug29446.phpt b/tests/classes/bug29446.phpt new file mode 100644 index 0000000..5e30e8e --- /dev/null +++ b/tests/classes/bug29446.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #29446 (ZE allows multiple declarations of the same class constant) +--FILE-- + +--EXPECTF-- +Fatal error: Cannot redefine class constant testClass::TEST_CONST in %s on line 5 \ No newline at end of file diff --git a/tests/classes/bug63462.phpt b/tests/classes/bug63462.phpt new file mode 100644 index 0000000..dc5edbd --- /dev/null +++ b/tests/classes/bug63462.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test script to verify that magic methods should be called only once when accessing an unset property. +--CREDITS-- +Marco Pivetta +--XFAIL-- +Bug 63462 is not yet fixed +--FILE-- +publicProperty, + $this->protectedProperty, + $this->privateProperty + ); + } + + function __get($name) { + echo '__get ' . $name . "\n"; + return $this->$name; + } + + function __set($name, $value) { + echo '__set ' . $name . "\n"; + $this->$name = $value; + } + + function __isset($name) { + echo '__isset ' . $name . "\n"; + return isset($this->$name); + } +} + +$test = new Test(); + +$test->nonExisting; +$test->publicProperty; +$test->protectedProperty; +$test->privateProperty; +isset($test->nonExisting); +isset($test->publicProperty); +isset($test->protectedProperty); +isset($test->privateProperty); +$test->nonExisting = 'value'; +$test->publicProperty = 'value'; +$test->protectedProperty = 'value'; +$test->privateProperty = 'value'; + +?> + +--EXPECTF-- +__get nonExisting +Notice: Undefined index: nonExisting in %__set__get_006.php on line %d +__get publicProperty +Notice: Undefined index: publicProperty in %__set__get_006.php on line %d +__get protectedProperty +Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d +__get privateProperty +Notice: Undefined index: privateProperty in %__set__get_006.php on line %d +__isset nonExisting +__isset publicProperty +__isset protectedProperty +__isset privateProperty +__set nonExisting +__set publicProperty +__set protectedProperty +__set privateProperty diff --git a/tests/classes/class_abstract.phpt b/tests/classes/class_abstract.phpt new file mode 100644 index 0000000..880f849 --- /dev/null +++ b/tests/classes/class_abstract.phpt @@ -0,0 +1,28 @@ +--TEST-- +ZE2 An abstract class cannot be instanciated +--SKIPIF-- + +--FILE-- +show(); + +$t = new base(); +$t->show(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +base + +Fatal error: Cannot instantiate abstract class base in %s on line %d diff --git a/tests/classes/class_example.phpt b/tests/classes/class_example.phpt new file mode 100644 index 0000000..621958b --- /dev/null +++ b/tests/classes/class_example.phpt @@ -0,0 +1,85 @@ +--TEST-- +Classes general test +--FILE-- + +first_name."\n"; + echo "Family name:\t ".$this->family_name."\n"; + echo "Address:\t ".$this->address."\n"; + echo "Phone:\t\t ".$this->phone_num."\n"; + echo "\n\n"; + } + function initialize($first_name,$family_name,$address,$phone_num) + { + $this->first_name = $first_name; + $this->family_name = $family_name; + $this->address = $address; + $this->phone_num = $phone_num; + } +}; + + +function test($u) +{ /* one can pass classes as arguments */ + $u->display(); + $t = $u; + $t->address = "New address..."; + return $t; /* and also return them as return values */ +} + +$user1 = new user; +$user2 = new user; + +$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik, Israel","+972-4-8713139"); +$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621"); +$user1->display(); +$user2->display(); + +$tmp = test($user2); +$tmp->display(); + +?> +--EXPECT-- +User information +---------------- + +First name: Zeev +Family name: Suraski +Address: Ben Gourion 3, Kiryat Bialik, Israel +Phone: +972-4-8713139 + + +User information +---------------- + +First name: Andi +Family name: Gutmans +Address: Haifa, Israel +Phone: +972-4-8231621 + + +User information +---------------- + +First name: Andi +Family name: Gutmans +Address: Haifa, Israel +Phone: +972-4-8231621 + + +User information +---------------- + +First name: Andi +Family name: Gutmans +Address: New address... +Phone: +972-4-8231621 diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt new file mode 100644 index 0000000..5c73cb2 --- /dev/null +++ b/tests/classes/class_final.phpt @@ -0,0 +1,22 @@ +--TEST-- +ZE2 A final class cannot be inherited +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Class derived may not inherit from final class (base) in %s on line %d diff --git a/tests/classes/class_stdclass.phpt b/tests/classes/class_stdclass.phpt new file mode 100644 index 0000000..5e3422a --- /dev/null +++ b/tests/classes/class_stdclass.phpt @@ -0,0 +1,14 @@ +--TEST-- +Instantiate stdClass +--FILE-- + +--EXPECTF-- +stdClass +Done diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt new file mode 100644 index 0000000..eb06c1f --- /dev/null +++ b/tests/classes/clone_001.phpt @@ -0,0 +1,43 @@ +--TEST-- +ZE2 object cloning, 1 +--SKIPIF-- + +--FILE-- +p2 = 'A'; +$obj->p3 = 'B'; +$copy = clone $obj; +$copy->p3 = 'C'; +echo "Object\n"; +var_dump($obj); +echo "Clown\n"; +var_dump($copy); +echo "Done\n"; +?> +--EXPECT-- +Object +object(test)#1 (3) { + ["p1"]=> + int(1) + ["p2"]=> + string(1) "A" + ["p3"]=> + string(1) "B" +} +Clown +object(test)#2 (3) { + ["p1"]=> + int(1) + ["p2"]=> + string(1) "A" + ["p3"]=> + string(1) "C" +} +Done diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt new file mode 100644 index 0000000..4430a2c --- /dev/null +++ b/tests/classes/clone_002.phpt @@ -0,0 +1,45 @@ +--TEST-- +ZE2 object cloning, 2 +--SKIPIF-- + +--FILE-- +p2 = 'A'; +$obj->p3 = 'B'; +$copy = clone $obj; +$copy->p3 = 'C'; +echo "Object\n"; +var_dump($obj); +echo "Clown\n"; +var_dump($copy); +echo "Done\n"; +?> +--EXPECT-- +Object +object(test)#1 (3) { + ["p1"]=> + int(1) + ["p2"]=> + string(1) "A" + ["p3"]=> + string(1) "B" +} +Clown +object(test)#2 (3) { + ["p1"]=> + int(1) + ["p2"]=> + string(1) "A" + ["p3"]=> + string(1) "C" +} +Done diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt new file mode 100644 index 0000000..9a251c5 --- /dev/null +++ b/tests/classes/clone_003.phpt @@ -0,0 +1,58 @@ +--TEST-- +ZE2 object cloning, 3 +--SKIPIF-- + +--FILE-- +p5 = 'clone:5'; + } +} + +$obj = new test; +$obj->p4 = 'A'; +$copy = clone $obj; +echo "Object\n"; +print_r($obj); +echo "Clown\n"; +print_r($copy); +echo "Done\n"; +?> +--EXPECT-- +Object +test Object +( + [p1] => test:1 + [p3] => test:3 + [p4] => A + [p5] => test:5 + [p2] => base:2 + [p6:base:private] => base:6 +) +Clown +test Object +( + [p1] => test:1 + [p3] => test:3 + [p4] => A + [p5] => clone:5 + [p2] => base:2 + [p6:base:private] => base:6 +) +Done diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt new file mode 100644 index 0000000..2059103 --- /dev/null +++ b/tests/classes/clone_004.phpt @@ -0,0 +1,82 @@ +--TEST-- +ZE2 object cloning, 4 +--FILE-- +a = array(1,2); +$o1->b = array(3,4); +$o1->show(); + +echo "Clone\n"; +$o2 = clone $o1; +$o2->show(); + +echo "Modify\n"; +$o2->a = 5; +$o2->b = 6; +$o2->show(); + +echo "Done\n"; +?> +--EXPECT-- +Original +object(test)#1 (2) { + ["b"]=> + array(2) { + [0]=> + int(3) + [1]=> + int(4) + } + ["a"]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +Clone +object(test)#2 (2) { + ["b"]=> + array(2) { + [0]=> + int(3) + [1]=> + int(4) + } + ["a"]=> + array(2) { + [0]=> + int(1) + [1]=> + int(2) + } +} +Modify +object(test)#2 (2) { + ["b"]=> + int(6) + ["a"]=> + int(5) +} +Done diff --git a/tests/classes/clone_005.phpt b/tests/classes/clone_005.phpt new file mode 100644 index 0000000..bfe4d66 --- /dev/null +++ b/tests/classes/clone_005.phpt @@ -0,0 +1,19 @@ +--TEST-- +ZE2 object cloning, 5 +--FILE-- + +--EXPECTF-- +Fatal error: Cannot override final method base::__clone() in %sclone_005.php on line %d diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt new file mode 100644 index 0000000..de22fec --- /dev/null +++ b/tests/classes/clone_006.phpt @@ -0,0 +1,41 @@ +--TEST-- +ZE2 object cloning, 6 +--SKIPIF-- + +--INI-- +error_reporting=2047 +--FILE-- +id = self::$id++; + } + + function __clone() { + $this->address = "New York"; + $this->id = self::$id++; + } +} + +$original = new MyCloneable(); + +$original->name = "Hello"; +$original->address = "Tel-Aviv"; + +echo $original->id . "\n"; + +$clone = clone $original; + +echo $clone->id . "\n"; +echo $clone->name . "\n"; +echo $clone->address . "\n"; + +?> +--EXPECT-- +0 +1 +Hello +New York diff --git a/tests/classes/constants_basic_001.phpt b/tests/classes/constants_basic_001.phpt new file mode 100644 index 0000000..74b0fcd --- /dev/null +++ b/tests/classes/constants_basic_001.phpt @@ -0,0 +1,89 @@ +--TEST-- +Class constant declarations +--FILE-- + +--EXPECTF-- + +Notice: Undefined variable: undef in %s on line 5 + +Attempt to access various kinds of class constants: + +Notice: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s on line %d +string(9) "UNDEFINED" +int(1) +float(1.5) +int(1) +float(1.5) +int(-1) +float(-1.5) +int(15) +string(%d) "%s" +string(1) "C" +string(1) "C" +string(0) "" +int(1234) +int(456) +NULL +string(6) "hello1" +string(6) "hello2" +string(6) "hello2" +string(6) "hello2" + +Expecting fatal error: + +Fatal error: Undefined class constant 'c19' in %s on line 53 diff --git a/tests/classes/constants_basic_002.phpt b/tests/classes/constants_basic_002.phpt new file mode 100644 index 0000000..0e53ca9 --- /dev/null +++ b/tests/classes/constants_basic_002.phpt @@ -0,0 +1,32 @@ +--TEST-- +Basic class support - defining and reading a class constant. +--FILE-- +myConst); + + echo "\nClass constant not visible in object var_dump.\n"; + var_dump($myInstance) +?> +--EXPECTF-- + +Read class constant. +string(5) "hello" + +Fail to read class constant from instance. + +Notice: Undefined property: aclass::$myConst in %s on line 12 +NULL + +Class constant not visible in object var_dump. +object(aclass)#%d (0) { +} diff --git a/tests/classes/constants_basic_003.inc b/tests/classes/constants_basic_003.inc new file mode 100644 index 0000000..be193e6 --- /dev/null +++ b/tests/classes/constants_basic_003.inc @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/tests/classes/constants_basic_003.phpt b/tests/classes/constants_basic_003.phpt new file mode 100644 index 0000000..052af85 --- /dev/null +++ b/tests/classes/constants_basic_003.phpt @@ -0,0 +1,28 @@ +--TEST-- +Ensure class properties and constants can be defined in terms of constants that are not known at compile time. +--FILE-- + +--EXPECTF-- +string(12) "hello from A" +string(12) "hello from C" +string(12) "hello from A" +string(12) "hello from C" diff --git a/tests/classes/constants_basic_004.phpt b/tests/classes/constants_basic_004.phpt new file mode 100644 index 0000000..cade668 --- /dev/null +++ b/tests/classes/constants_basic_004.phpt @@ -0,0 +1,99 @@ +--TEST-- +Test properties with array default values using class constants as keys and values. +--FILE-- + B::VALUE); + public $a_x = array(B::KEY => B::VALUE); + } + + class B + { + const KEY = "key"; + const VALUE = "value"; + + // Static and instance array using class constants with self + public static $sa_b = array(self::KEY => self::VALUE); + public $a_b = array(self::KEY => self::VALUE); + } + + class C extends B + { + // Static and instance array using class constants with parent + public static $sa_c_parent = array(parent::KEY => parent::VALUE); + public $a_c_parent = array(parent::KEY => parent::VALUE); + + // Static and instance array using class constants with self (constants should be inherited) + public static $sa_c_self = array(self::KEY => self::VALUE); + public $a_c_self = array(self::KEY => self::VALUE); + + // Should also include inherited properties from B. + } + + echo "\nStatic properties:\n"; + var_dump(X::$sa_x, B::$sa_b, C::$sa_b, C::$sa_c_parent, C::$sa_c_self); + + echo "\nInstance properties:\n"; + $x = new x; + $b = new B; + $c = new C; + var_dump($x, $b, $c); +?> +--EXPECTF-- + +Static properties: +array(1) { + ["key"]=> + string(5) "value" +} +array(1) { + ["key"]=> + string(5) "value" +} +array(1) { + ["key"]=> + string(5) "value" +} +array(1) { + ["key"]=> + string(5) "value" +} +array(1) { + ["key"]=> + string(5) "value" +} + +Instance properties: +object(X)#%d (1) { + ["a_x"]=> + array(1) { + ["key"]=> + string(5) "value" + } +} +object(B)#%d (1) { + ["a_b"]=> + array(1) { + ["key"]=> + string(5) "value" + } +} +object(C)#%d (3) { + ["a_c_parent"]=> + array(1) { + ["key"]=> + string(5) "value" + } + ["a_c_self"]=> + array(1) { + ["key"]=> + string(5) "value" + } + ["a_b"]=> + array(1) { + ["key"]=> + string(5) "value" + } +} diff --git a/tests/classes/constants_basic_005.phpt b/tests/classes/constants_basic_005.phpt new file mode 100644 index 0000000..c840f53 --- /dev/null +++ b/tests/classes/constants_basic_005.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test constants with default values based on other constants. +--FILE-- + +--EXPECTF-- +string(5) "hello" +string(5) "hello" + diff --git a/tests/classes/constants_basic_006.phpt b/tests/classes/constants_basic_006.phpt new file mode 100644 index 0000000..73cf0ef --- /dev/null +++ b/tests/classes/constants_basic_006.phpt @@ -0,0 +1,43 @@ +--TEST-- +Ensure class constants are not evaluated when a class is looked up to resolve inheritance during runtime. +--FILE-- + D::V, E::A => K); + } + + eval('class D extends C { const V = \'test\'; }'); + + class E extends D + { + const A = "hello"; + } + + define('K', "nasty"); + + var_dump(C::X, C::$a, D::X, D::$a, E::X, E::$a); +?> +--EXPECTF-- +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} +string(5) "hello" +array(2) { + ["nasty"]=> + string(4) "test" + ["hello"]=> + string(5) "nasty" +} diff --git a/tests/classes/constants_error_001.phpt b/tests/classes/constants_error_001.phpt new file mode 100644 index 0000000..9bb5533 --- /dev/null +++ b/tests/classes/constants_error_001.phpt @@ -0,0 +1,13 @@ +--TEST-- +Error case: duplicate class constant definition +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot redefine class constant myclass::myConst in %s on line 5 diff --git a/tests/classes/constants_error_002.phpt b/tests/classes/constants_error_002.phpt new file mode 100644 index 0000000..be27971 --- /dev/null +++ b/tests/classes/constants_error_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Error case: class constant as an array +--FILE-- + +--EXPECTF-- + +Fatal error: Arrays are not allowed in class constants in %s on line 4 diff --git a/tests/classes/constants_error_003.phpt b/tests/classes/constants_error_003.phpt new file mode 100644 index 0000000..c67768c --- /dev/null +++ b/tests/classes/constants_error_003.phpt @@ -0,0 +1,20 @@ +--TEST-- +Basic class support - attempting to pass a class constant by reference. +--FILE-- + +--EXPECTF-- + +Fatal error: Only variables can be passed by reference in %s on line 12 diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt new file mode 100644 index 0000000..03e6725 --- /dev/null +++ b/tests/classes/constants_error_004.phpt @@ -0,0 +1,13 @@ +--TEST-- +Class constant whose initial value refereces a non-existent class +--FILE-- + +--EXPECTF-- +Fatal error: Class 'D' not found in %s on line %d diff --git a/tests/classes/constants_error_005.phpt b/tests/classes/constants_error_005.phpt new file mode 100644 index 0000000..1283783 --- /dev/null +++ b/tests/classes/constants_error_005.phpt @@ -0,0 +1,12 @@ +--TEST-- +Error case: class constant as an encapsed containing a variable +--FILE-- + +--EXPECTF-- + +Parse error: %s in %s on line %d diff --git a/tests/classes/constants_error_006.phpt b/tests/classes/constants_error_006.phpt new file mode 100644 index 0000000..f3f14b8 --- /dev/null +++ b/tests/classes/constants_error_006.phpt @@ -0,0 +1,16 @@ +--TEST-- +Basic class support - attempting to modify a class constant by assignment +--FILE-- + +--EXPECTF-- + +Parse error: %s in %s on line %d diff --git a/tests/classes/constants_error_007.phpt b/tests/classes/constants_error_007.phpt new file mode 100644 index 0000000..4be8d88 --- /dev/null +++ b/tests/classes/constants_error_007.phpt @@ -0,0 +1,15 @@ +--TEST-- +Basic class support - attempting to create a reference to a class constant +--FILE-- + +--EXPECTF-- + +Parse error: %s in %s on line %d diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt new file mode 100644 index 0000000..5006628 --- /dev/null +++ b/tests/classes/constants_scope_001.phpt @@ -0,0 +1,38 @@ +--TEST-- +ZE2 class constants and scope +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d +FATAL = FATAL +self::FATAL = Fatal error +self::FATAL = Worst error +parent::FATAL = Fatal error diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt new file mode 100644 index 0000000..ea6813c --- /dev/null +++ b/tests/classes/ctor_dtor.phpt @@ -0,0 +1,40 @@ +--TEST-- +ZE2 The new constructor/destructor is called +--SKIPIF-- + +--FILE-- +early(); +unset($t); +$t = new late(); +//unset($t); delay to end of script + +echo "Done\n"; +?> +--EXPECTF-- +early::early +early::early +early::__destruct +late::__construct +Done +late::__destruct diff --git a/tests/classes/ctor_dtor_inheritance.phpt b/tests/classes/ctor_dtor_inheritance.phpt new file mode 100644 index 0000000..8ae2a5d --- /dev/null +++ b/tests/classes/ctor_dtor_inheritance.phpt @@ -0,0 +1,99 @@ +--TEST-- +ZE2 A derived class can use the inherited constructor/destructor +--SKIPIF-- + +--FILE-- +name = 'base'; + print_r($this); + } + + function __destruct() { + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + print_r($this); + } +} + +class derived extends base { + public $other; + + function __construct() { + $this->name = 'init'; + $this->other = 'other'; + print_r($this); + parent::__construct(); + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + $this->name = 'derived'; + print_r($this); + } + + function __destruct() { + parent::__destruct(); + echo __CLASS__ . "::" . __FUNCTION__ . "\n"; + print_r($this); + } +} + +echo "Testing class base\n"; +$t = new base(); +unset($t); +echo "Testing class derived\n"; +$t = new derived(); +unset($t); + +echo "Done\n"; +?> +--EXPECTF-- +Testing class base +base::__construct +base Object +( + [name] => base +) +base::__destruct +base Object +( + [name] => base +) +Testing class derived +derived Object +( + [other] => other + [name] => init +) +base::__construct +derived Object +( + [other] => other + [name] => base +) +derived::__construct +derived Object +( + [other] => other + [name] => derived +) +base::__destruct +derived Object +( + [other] => other + [name] => derived +) +derived::__destruct +derived Object +( + [other] => other + [name] => derived +) +Done diff --git a/tests/classes/ctor_failure.phpt b/tests/classes/ctor_failure.phpt new file mode 100644 index 0000000..b7d3b64 --- /dev/null +++ b/tests/classes/ctor_failure.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 Do not call destructors if constructor fails +--FILE-- +getMessage() . ")\n"; +} + +?> +===DONE=== +--EXPECT-- +Test::__construct(Hello) +Caught Exception(Hello) +===DONE=== diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt new file mode 100644 index 0000000..e5ad30e --- /dev/null +++ b/tests/classes/ctor_in_interface_01.phpt @@ -0,0 +1,19 @@ +--TEST-- +ZE2 A class constructor must keep the signature of an interface +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of implem::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt new file mode 100644 index 0000000..08e6f36 --- /dev/null +++ b/tests/classes/ctor_in_interface_02.phpt @@ -0,0 +1,34 @@ +--TEST-- +ZE2 A class constructor must keep the signature of all interfaces +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of implem13::__construct() must be compatible with constr3::__construct($a) in %s on line %d diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt new file mode 100644 index 0000000..ac73331 --- /dev/null +++ b/tests/classes/ctor_in_interface_03.phpt @@ -0,0 +1,23 @@ +--TEST-- +ZE2 A class constructor must keep the signature of base class interfaces +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt new file mode 100644 index 0000000..94be655 --- /dev/null +++ b/tests/classes/ctor_in_interface_04.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 A class constructor must keep the signature of base class interfaces +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_name_clash.phpt b/tests/classes/ctor_name_clash.phpt new file mode 100644 index 0000000..1a1d6fa --- /dev/null +++ b/tests/classes/ctor_name_clash.phpt @@ -0,0 +1,22 @@ +--TEST-- +ZE2 The child class can re-use the parent class name for a function member +--FILE-- +base(); +?> +--EXPECTF-- +base::base +derived::base diff --git a/tests/classes/ctor_visibility.phpt b/tests/classes/ctor_visibility.phpt new file mode 100644 index 0000000..8d3b1c5 --- /dev/null +++ b/tests/classes/ctor_visibility.phpt @@ -0,0 +1,69 @@ +--TEST-- +ZE2 A private constructor cannot be called +--FILE-- + +===DONE=== +--EXPECTF-- +Derived::__construct() +Test::__construct() +TestPriv::__construct() +DerivedPriv::__construct() + +Fatal error: Cannot call private TestPriv::__construct() in %sctor_visibility.php on line %d diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt new file mode 100644 index 0000000..dd2aba7 --- /dev/null +++ b/tests/classes/dereferencing_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 dereferencing of objects from methods +--SKIPIF-- + +--FILE-- +name = $_name; + } + + function display() { + echo $this->name . "\n"; + } +} + +class Person { + private $name; + + function person($_name, $_address) { + $this->name = new Name($_name); + } + + function getName() { + return $this->name; + } +} + +$person = new Person("John", "New York"); +$person->getName()->display(); + +?> +--EXPECT-- +John diff --git a/tests/classes/destructor_and_echo.phpt b/tests/classes/destructor_and_echo.phpt new file mode 100644 index 0000000..0a25359 --- /dev/null +++ b/tests/classes/destructor_and_echo.phpt @@ -0,0 +1,24 @@ +--TEST-- +ZE2 Destructors and echo +--FILE-- + +===DONE=== +--EXPECT-- +Test::__construct +===DONE=== +Test::__destruct diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt new file mode 100644 index 0000000..8100c92 --- /dev/null +++ b/tests/classes/destructor_and_exceptions.phpt @@ -0,0 +1,60 @@ +--TEST-- +ZE2 catch exception thrown in destructor +--FILE-- +getMessage() . "\n"; +} + +class FatalException extends Exception +{ + function __construct($what) + { + echo __METHOD__ . "\n"; + $o = new FailClass; + unset($o); + echo "Done: " . __METHOD__ . "\n"; + } +} + +try +{ + throw new FatalException("Damn"); +} +catch(Exception $e) +{ + echo "Caught Exception: " . $e->getMessage() . "\n"; +} +catch(FatalException $e) +{ + echo "Caught FatalException: " . $e->getMessage() . "\n"; +} + +?> +===DONE=== +--EXPECTF-- +FailClass::__destruct +Caught: FailClass +FatalException::__construct +FailClass::__destruct +Caught Exception: FailClass +===DONE=== diff --git a/tests/classes/destructor_and_globals.phpt b/tests/classes/destructor_and_globals.phpt new file mode 100644 index 0000000..9caf0f1 --- /dev/null +++ b/tests/classes/destructor_and_globals.phpt @@ -0,0 +1,56 @@ +--TEST-- +ZE2 accessing globals from destructor in shutdown +--FILE-- +id = $test_num++; + } + + public function Show() { + echo 'Id: '.$this->id."\n"; + } + + // try protected here + public function __destruct() { + global $test_cnt; + $test_cnt--; + } + + static public function destroy(&$obj) { + $obj = NULL; + } +} +Show(); +$obj1 = new counter; +$obj1->Show(); +Show(); +$obj2 = new counter; +$obj2->Show(); +Show(); +counter::destroy($obj1); +Show(); +// or uncomment this line and it works +//counter::destroy($obj2); +echo "Done\n"; +?> +--EXPECT-- +Count: 0 +Id: 0 +Count: 1 +Id: 1 +Count: 2 +Count: 1 +Done diff --git a/tests/classes/destructor_and_references.phpt b/tests/classes/destructor_and_references.phpt new file mode 100644 index 0000000..6b9b019 --- /dev/null +++ b/tests/classes/destructor_and_references.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 Destructing and references +--FILE-- +x = &$o4; + +$r1 = &$o1; + +class once {} + +$o = new once; +echo "Done\n"; +?> +--EXPECT-- +Done diff --git a/tests/classes/destructor_inheritance.phpt b/tests/classes/destructor_inheritance.phpt new file mode 100644 index 0000000..b9a4665 --- /dev/null +++ b/tests/classes/destructor_inheritance.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 The inherited destructor is called +--SKIPIF-- + +--FILE-- + +--EXPECT-- +base::__construct +base::__destruct +Done \ No newline at end of file diff --git a/tests/classes/destructor_visibility_001.phpt b/tests/classes/destructor_visibility_001.phpt new file mode 100644 index 0000000..7674c51 --- /dev/null +++ b/tests/classes/destructor_visibility_001.phpt @@ -0,0 +1,24 @@ +--TEST-- +ZE2 Ensuring destructor visibility +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +Fatal error: Call to private Derived::__destruct() from context '' in %sdestructor_visibility_001.php on line %d diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt new file mode 100644 index 0000000..2cc8333 --- /dev/null +++ b/tests/classes/destructor_visibility_002.phpt @@ -0,0 +1,24 @@ +--TEST-- +ZE2 Ensuring destructor visibility +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +===DONE=== + +Warning: Call to private Derived::__destruct() from context '' during shutdown ignored in Unknown on line %d diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt new file mode 100644 index 0000000..83e3efe --- /dev/null +++ b/tests/classes/destructor_visibility_003.phpt @@ -0,0 +1,28 @@ +--TEST-- +ZE2 Ensuring destructor visibility +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +Derived::__destruct +===DONE=== diff --git a/tests/classes/factory_001.phpt b/tests/classes/factory_001.phpt new file mode 100644 index 0000000..97b69c1 --- /dev/null +++ b/tests/classes/factory_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 factory objects +--SKIPIF-- + +--FILE-- +draw(); +ShapeFactoryMethod("Square")->draw(); + +?> +--EXPECT-- +Circle +Square diff --git a/tests/classes/factory_and_singleton_001.phpt b/tests/classes/factory_and_singleton_001.phpt new file mode 100644 index 0000000..70fa020 --- /dev/null +++ b/tests/classes/factory_and_singleton_001.phpt @@ -0,0 +1,101 @@ +--TEST-- +ZE2 factory and singleton, test 1 +--SKIPIF-- + +--FILE-- +x = $x; + } + + static function destroy() { + test::$test = NULL; + } + + protected function __destruct() { + test::$cnt--; + } + + public function get() { + return $this->x; + } + + static public function getX() { + if (test::$test) { + return test::$test->x; + } else { + return NULL; + } + } + + static public function count() { + return test::$cnt; + } +} + +echo "Access static members\n"; +var_dump(test::getX()); +var_dump(test::count()); + +echo "Create x and y\n"; +$x = test::factory(1); +$y = test::factory(2); +var_dump(test::getX()); +var_dump(test::count()); +var_dump($x->get()); +var_dump($y->get()); + +echo "Destruct x\n"; +$x = NULL; +var_dump(test::getX()); +var_dump(test::count()); +var_dump($y->get()); + +echo "Destruct y\n"; +$y = NULL; +var_dump(test::getX()); +var_dump(test::count()); + +echo "Destruct static\n"; +test::destroy(); +var_dump(test::getX()); +var_dump(test::count()); + +echo "Done\n"; +?> +--EXPECT-- +Access static members +NULL +int(0) +Create x and y +int(1) +int(1) +int(1) +int(1) +Destruct x +int(1) +int(1) +int(1) +Destruct y +int(1) +int(1) +Destruct static +NULL +int(0) +Done diff --git a/tests/classes/factory_and_singleton_002.phpt b/tests/classes/factory_and_singleton_002.phpt new file mode 100644 index 0000000..3308a56 --- /dev/null +++ b/tests/classes/factory_and_singleton_002.phpt @@ -0,0 +1,100 @@ +--TEST-- +ZE2 factory and singleton, test 2 +--SKIPIF-- + +--FILE-- +x = $x; + } + + static function destroy() { + test::$test = NULL; + } + + protected function __destruct() { + test::$cnt--; + } + + public function get() { + return $this->x; + } + + static public function getX() { + if (test::$test) { + return test::$test->x; + } else { + return NULL; + } + } + + static public function count() { + return test::$cnt; + } +} + +echo "Access static members\n"; +var_dump(test::getX()); +var_dump(test::count()); + +echo "Create x and y\n"; +$x = test::factory(1); +$y = test::factory(2); +var_dump(test::getX()); +var_dump(test::count()); +var_dump($x->get()); +var_dump($y->get()); + +echo "Destruct x\n"; +$x = NULL; +var_dump(test::getX()); +var_dump(test::count()); +var_dump($y->get()); + +echo "Destruct y\n"; +$y = NULL; +var_dump(test::getX()); +var_dump(test::count()); + +//echo "Destruct static\n"; +//test::destroy(); +//var_dump(test::getX()); +//var_dump(test::count()); + +echo "Done\n"; +?> +--EXPECT-- +Access static members +NULL +int(0) +Create x and y +int(1) +int(1) +int(1) +int(1) +Destruct x +int(1) +int(1) +int(1) +Destruct y +int(1) +int(1) +Done + +Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt new file mode 100644 index 0000000..3d50a81 --- /dev/null +++ b/tests/classes/factory_and_singleton_003.phpt @@ -0,0 +1,18 @@ +--TEST-- +ZE2 factory and singleton, test 3 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to protected test::__construct() from invalid context in %s on line %d diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt new file mode 100644 index 0000000..14edcb1 --- /dev/null +++ b/tests/classes/factory_and_singleton_004.phpt @@ -0,0 +1,18 @@ +--TEST-- +ZE2 factory and singleton, test 4 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to private test::__construct() from invalid context in %s on line %d diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt new file mode 100644 index 0000000..2cd7e5c --- /dev/null +++ b/tests/classes/factory_and_singleton_005.phpt @@ -0,0 +1,19 @@ +--TEST-- +ZE2 factory and singleton, test 5 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php on line %d diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt new file mode 100644 index 0000000..81cf714 --- /dev/null +++ b/tests/classes/factory_and_singleton_006.phpt @@ -0,0 +1,20 @@ +--TEST-- +ZE2 factory and singleton, test 6 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php on line %d + diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt new file mode 100644 index 0000000..4788dbf --- /dev/null +++ b/tests/classes/factory_and_singleton_007.phpt @@ -0,0 +1,20 @@ +--TEST-- +ZE2 factory and singleton, test 7 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to protected test::__clone() from context '' %sfactory_and_singleton_007.php on line %d diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt new file mode 100644 index 0000000..750b9db --- /dev/null +++ b/tests/classes/factory_and_singleton_008.phpt @@ -0,0 +1,20 @@ +--TEST-- +ZE2 factory and singleton, test 8 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Call to private test::__clone() from context '' %sfactory_and_singleton_008.php on line %d diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt new file mode 100644 index 0000000..acf792c --- /dev/null +++ b/tests/classes/factory_and_singleton_009.phpt @@ -0,0 +1,21 @@ +--TEST-- +ZE2 factory and singleton, test 9 +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +===DONE=== + +Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt new file mode 100644 index 0000000..0f5fb2d --- /dev/null +++ b/tests/classes/factory_and_singleton_010.phpt @@ -0,0 +1,21 @@ +--TEST-- +ZE2 factory and singleton, test 10 +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +===DONE=== + +Warning: Call to private test::__destruct() from context '' during shutdown ignored in Unknown on line 0 diff --git a/tests/classes/final.phpt b/tests/classes/final.phpt new file mode 100644 index 0000000..b4e37a3 --- /dev/null +++ b/tests/classes/final.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 A method may be redeclared final +--SKIPIF-- + +--FILE-- +show(); + +class second extends first { + final function show() { + echo "Call to function second::show()\n"; + } +} + +$t2 = new second(); +$t2->show(); + +echo "Done\n"; +?> +--EXPECTF-- +Call to function first::show() +Call to function second::show() +Done \ No newline at end of file diff --git a/tests/classes/final_abstract.phpt b/tests/classes/final_abstract.phpt new file mode 100644 index 0000000..426c852 --- /dev/null +++ b/tests/classes/final_abstract.phpt @@ -0,0 +1,16 @@ +--TEST-- +ZE2 A final method cannot be abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot use the final modifier on an abstract class member in %s diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt new file mode 100644 index 0000000..ebfa080 --- /dev/null +++ b/tests/classes/final_ctor1.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 cannot override final __construct +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt new file mode 100644 index 0000000..905337b --- /dev/null +++ b/tests/classes/final_ctor2.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 cannot override final old style ctor +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d diff --git a/tests/classes/final_ctor3.phpt b/tests/classes/final_ctor3.phpt new file mode 100644 index 0000000..3a61ecf --- /dev/null +++ b/tests/classes/final_ctor3.phpt @@ -0,0 +1,13 @@ +--TEST-- +Ensure implicit final inherited old-style constructor cannot be overridden. +--FILE-- + +--EXPECTF-- +Fatal error: Cannot override final method A::A() in %s on line %d diff --git a/tests/classes/final_redeclare.phpt b/tests/classes/final_redeclare.phpt new file mode 100644 index 0000000..e8f2e6f --- /dev/null +++ b/tests/classes/final_redeclare.phpt @@ -0,0 +1,25 @@ +--TEST-- +ZE2 A final method may not be overwritten +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Cannot override final method pass::show() in %s on line %d diff --git a/tests/classes/implicit_instantiation_001.phpt b/tests/classes/implicit_instantiation_001.phpt new file mode 100644 index 0000000..8d2f32d --- /dev/null +++ b/tests/classes/implicit_instantiation_001.phpt @@ -0,0 +1,146 @@ +--TEST-- +Implicit object instantiation when accessing properties of non-object. +--FILE-- + $value) { + echo "\n\n---( \$c->$name )---"; + echo "\n --> Attempting implicit conversion to object using increment...\n"; + $c->$name->prop++; + $c->$name = $value; // reset value in case implicit conversion was successful + + echo "\n --> Attempting implicit conversion to object using assignment...\n"; + $c->$name->prop = "Implicit instantiation!"; + $c->$name = $value; // reset value in case implicit conversion was successful + + echo "\n --> Attempting implicit conversion to object using combined assignment...\n"; + $c->$name->prop .= " Implicit instantiation!"; +} + +echo "\n\n\n --> Resulting object:"; +var_dump($c); + +?> +--EXPECTF-- + + +---( $c->boolFalse )--- + --> Attempting implicit conversion to object using increment... + +Warning: Creating default object from empty value in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Creating default object from empty value in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Creating default object from empty value in %s on line 26 + + +---( $c->emptyString )--- + --> Attempting implicit conversion to object using increment... + +Warning: Creating default object from empty value in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Creating default object from empty value in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Creating default object from empty value in %s on line 26 + + +---( $c->null )--- + --> Attempting implicit conversion to object using increment... + +Warning: Creating default object from empty value in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Creating default object from empty value in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Creating default object from empty value in %s on line 26 + + +---( $c->boolTrue )--- + --> Attempting implicit conversion to object using increment... + +Warning: Attempt to %s property of non-object in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Attempt to assign property of non-object in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Attempt to assign property of non-object in %s on line 26 + + +---( $c->nonEmptyString )--- + --> Attempting implicit conversion to object using increment... + +Warning: Attempt to %s property of non-object in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Attempt to assign property of non-object in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Attempt to assign property of non-object in %s on line 26 + + +---( $c->intZero )--- + --> Attempting implicit conversion to object using increment... + +Warning: Attempt to %s property of non-object in %s on line 18 + + --> Attempting implicit conversion to object using assignment... + +Warning: Attempt to assign property of non-object in %s on line 22 + + --> Attempting implicit conversion to object using combined assignment... + +Warning: Attempt to assign property of non-object in %s on line 26 + + + + --> Resulting object:object(C)#%d (6) { + [%u|b%"boolFalse"]=> + object(stdClass)#%d (1) { + [%u|b%"prop"]=> + %unicode|string%(24) " Implicit instantiation!" + } + [%u|b%"emptyString"]=> + object(stdClass)#%d (1) { + [%u|b%"prop"]=> + %unicode|string%(24) " Implicit instantiation!" + } + [%u|b%"null"]=> + object(stdClass)#%d (1) { + [%u|b%"prop"]=> + %unicode|string%(24) " Implicit instantiation!" + } + [%u|b%"boolTrue"]=> + bool(true) + [%u|b%"nonEmptyString"]=> + %unicode|string%(5) "hello" + [%u|b%"intZero"]=> + int(0) +} \ No newline at end of file diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt new file mode 100644 index 0000000..97a24d3 --- /dev/null +++ b/tests/classes/incdec_property_001.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 post increment/decrement property of overloaded object +--FILE-- +real_a = $value; + } + } + + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } +} + +$obj = new Test; +var_dump($obj->a); +$obj->a++; +var_dump($obj->a); +echo "---Done---\n"; +?> +--EXPECT-- +int(2) +int(3) +---Done--- diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt new file mode 100644 index 0000000..c1d7dde --- /dev/null +++ b/tests/classes/incdec_property_002.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 post increment/decrement property of overloaded object with assignment +--FILE-- +real_a = $value; + } + } + + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } +} + +$obj = new Test; +var_dump($obj->a); +$t1 = $obj->a++; +var_dump($obj->a); +echo "---Done---\n"; +?> +--EXPECT-- +int(2) +int(3) +---Done--- diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt new file mode 100644 index 0000000..1a92384 --- /dev/null +++ b/tests/classes/incdec_property_003.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 pre increment/decrement property of overloaded object +--FILE-- +real_a = $value; + } + } + + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } +} + +$obj = new Test; +var_dump($obj->a); +++$obj->a; +var_dump($obj->a); +echo "---Done---\n"; +?> +--EXPECT-- +int(2) +int(3) +---Done--- diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt new file mode 100644 index 0000000..05e3b44 --- /dev/null +++ b/tests/classes/incdec_property_004.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 pre increment/decrement property of overloaded object with assignment +--FILE-- +real_a = $value; + } + } + + function __get($property) { + if ($property == "a") { + return $this->real_a; + } + } +} + +$obj = new Test; +var_dump($obj->a); +$t1 = ++$obj->a; +var_dump($obj->a); +echo "---Done---\n"; +?> +--EXPECT-- +int(2) +int(3) +---Done--- diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt new file mode 100644 index 0000000..070ad91 --- /dev/null +++ b/tests/classes/inheritance.phpt @@ -0,0 +1,56 @@ +--TEST-- +Classes inheritance test +--FILE-- +a."\n"; + echo "b = ".$this->b."\n"; + } + function mul() { + return $this->a*$this->b; + } +}; + +class bar extends foo { + public $c; + function display() { /* alternative display function for class bar */ + echo "This is class bar\n"; + echo "a = ".$this->a."\n"; + echo "b = ".$this->b."\n"; + echo "c = ".$this->c."\n"; + } +}; + + +$foo1 = new foo; +$foo1->a = 2; +$foo1->b = 5; +$foo1->display(); +echo $foo1->mul()."\n"; + +echo "-----\n"; + +$bar1 = new bar; +$bar1->a = 4; +$bar1->b = 3; +$bar1->c = 12; +$bar1->display(); +echo $bar1->mul()."\n"; +--EXPECT-- +This is class foo +a = 2 +b = 5 +10 +----- +This is class bar +a = 4 +b = 3 +c = 12 +12 diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt new file mode 100644 index 0000000..cca528e --- /dev/null +++ b/tests/classes/inheritance_002.phpt @@ -0,0 +1,71 @@ +--TEST-- +ZE2 Constructor precedence +--SKIPIF-- + +--FILE-- + +--EXPECT-- +### PHP 4 style +string(17) "Child constructor" +string(16) "Base constructor" +### PHP 5 style +string(17) "Child constructor" +string(16) "Base constructor" +### Mixed style 1 +string(17) "Child constructor" +string(16) "Base constructor" +### Mixed style 2 +string(17) "Child constructor" +string(16) "Base constructor" diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt new file mode 100644 index 0000000..1f4eafa --- /dev/null +++ b/tests/classes/inheritance_003.phpt @@ -0,0 +1,21 @@ +--TEST-- +ZE2 method inheritance without interfaces +--FILE-- + +===DONE=== +--EXPECTF-- + +Strict Standards: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d +===DONE=== diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt new file mode 100644 index 0000000..d1f5faf --- /dev/null +++ b/tests/classes/inheritance_004.phpt @@ -0,0 +1,21 @@ +--TEST-- +ZE2 method inheritance without interfaces +--FILE-- + +===DONE=== +--EXPECTF-- + +Strict Standards: Declaration of B::f() should be compatible with A::f() in %sinheritance_004.php on line %d +===DONE=== diff --git a/tests/classes/inheritance_005.phpt b/tests/classes/inheritance_005.phpt new file mode 100644 index 0000000..8990264 --- /dev/null +++ b/tests/classes/inheritance_005.phpt @@ -0,0 +1,57 @@ +--TEST-- +Check for inherited old-style constructor. +--FILE-- + +--EXPECTF-- +About to construct new B: +In A::A +Is B::B() callable? +bool(false) +Is B::A() callable? +bool(true) +About to construct new C: +In A::A +Is C::A() callable? +bool(true) +Is C::B() callable? +bool(false) +Is C::C() callable? +bool(false) diff --git a/tests/classes/inheritance_006.phpt b/tests/classes/inheritance_006.phpt new file mode 100644 index 0000000..d51dafe --- /dev/null +++ b/tests/classes/inheritance_006.phpt @@ -0,0 +1,24 @@ +--TEST-- +Private property inheritance check +--FILE-- + +--EXPECTF-- +object(C)#%d (2) { + [%u|b%"c":%u|b%"B":private]=> + NULL + [%u|b%"c":%u|b%"A":private]=> + NULL +} \ No newline at end of file diff --git a/tests/classes/inheritance_007.phpt b/tests/classes/inheritance_007.phpt new file mode 100644 index 0000000..0b2bde0 --- /dev/null +++ b/tests/classes/inheritance_007.phpt @@ -0,0 +1,39 @@ +--TEST-- +Ensure inherited old-style constructor doesn't block other methods +--FILE-- +getMethods()); + + +$b = new B(); +$b->a(); +$b->b(); + +?> +--EXPECTF-- +array(2) { + [0]=> + &object(ReflectionMethod)#%d (2) { + ["name"]=> + string(1) "B" + ["class"]=> + string(1) "A" + } + [1]=> + &object(ReflectionMethod)#%d (2) { + ["name"]=> + string(1) "A" + ["class"]=> + string(1) "A" + } +} +In A::A +In A::A +In A::B diff --git a/tests/classes/interface_and_extends.phpt b/tests/classes/interface_and_extends.phpt new file mode 100644 index 0000000..f9040ae --- /dev/null +++ b/tests/classes/interface_and_extends.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 a class cannot extend an interface +--SKIPIF-- + +--FILE-- +show(); + +?> +===DONE=== +--EXPECTF-- +Fatal error: Class Tester cannot extend from interface Test in %sinterface_and_extends.php on line %d diff --git a/tests/classes/interface_class.phpt b/tests/classes/interface_class.phpt new file mode 100644 index 0000000..22520de --- /dev/null +++ b/tests/classes/interface_class.phpt @@ -0,0 +1,14 @@ +--TEST-- +ZE2 A class can only implement interfaces +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: derived cannot implement base - it is not an interface in %s on line %d diff --git a/tests/classes/interface_constant_inheritance_001.phpt b/tests/classes/interface_constant_inheritance_001.phpt new file mode 100644 index 0000000..f982a4a --- /dev/null +++ b/tests/classes/interface_constant_inheritance_001.phpt @@ -0,0 +1,17 @@ +--TEST-- +Ensure an interface may not shadow an inherited constant. +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I1 in %s on line 6 diff --git a/tests/classes/interface_constant_inheritance_002.phpt b/tests/classes/interface_constant_inheritance_002.phpt new file mode 100644 index 0000000..af4ce69 --- /dev/null +++ b/tests/classes/interface_constant_inheritance_002.phpt @@ -0,0 +1,17 @@ +--TEST-- +Ensure a class may not shadow a constant inherited from an interface. +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I in %s on line 6 diff --git a/tests/classes/interface_constant_inheritance_003.phpt b/tests/classes/interface_constant_inheritance_003.phpt new file mode 100644 index 0000000..6b4139b --- /dev/null +++ b/tests/classes/interface_constant_inheritance_003.phpt @@ -0,0 +1,20 @@ +--TEST-- +Ensure a class may not inherit two constants with the same name from two separate interfaces. +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I2 in %s on line 10 diff --git a/tests/classes/interface_constant_inheritance_004.phpt b/tests/classes/interface_constant_inheritance_004.phpt new file mode 100644 index 0000000..f055929 --- /dev/null +++ b/tests/classes/interface_constant_inheritance_004.phpt @@ -0,0 +1,18 @@ +--TEST-- +Ensure a class may implement two interfaces which include the same constant (due to inheritance). +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt new file mode 100644 index 0000000..e1dd31f --- /dev/null +++ b/tests/classes/interface_doubled.phpt @@ -0,0 +1,201 @@ +--TEST-- +ZE2 An interface extends base interfaces +--SKIPIF-- + +--FILE-- +test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_b\n"; + +class class_b extends base implements if_a, if_b { + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_b(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_c\n"; + +class class_c extends base implements if_c { + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_c(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_d\n"; + +class class_d extends base implements if_d{ + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_d(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_e\n"; + +class class_e extends base implements if_a, if_b, if_c, if_d { + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_e(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_f\n"; + +class class_f extends base implements if_e { + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_f(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +echo "class_g\n"; + +class class_g extends base implements if_f { + function f_a() {} + function f_b() {} + function f_c() {} + function f_d() {} + function f_e() {} +} + +$t = new class_g(); +echo $t->test('if_a'); +echo $t->test('if_b'); +echo $t->test('if_c'); +echo $t->test('if_d'); +echo $t->test('if_e'); + +?> +===DONE=== +--EXPECTF-- +class_a +is_a(class_a, if_a) yes +is_a(class_a, if_b) no +is_a(class_a, if_c) no +is_a(class_a, if_d) no +is_a(class_a, if_e) no +class_b +is_a(class_b, if_a) yes +is_a(class_b, if_b) yes +is_a(class_b, if_c) no +is_a(class_b, if_d) no +is_a(class_b, if_e) no +class_c +is_a(class_c, if_a) yes +is_a(class_c, if_b) yes +is_a(class_c, if_c) yes +is_a(class_c, if_d) no +is_a(class_c, if_e) no +class_d +is_a(class_d, if_a) yes +is_a(class_d, if_b) yes +is_a(class_d, if_c) no +is_a(class_d, if_d) yes +is_a(class_d, if_e) no +class_e +is_a(class_e, if_a) yes +is_a(class_e, if_b) yes +is_a(class_e, if_c) yes +is_a(class_e, if_d) yes +is_a(class_e, if_e) no +class_f +is_a(class_f, if_a) no +is_a(class_f, if_b) no +is_a(class_f, if_c) no +is_a(class_f, if_d) no +is_a(class_f, if_e) yes +class_g +is_a(class_g, if_a) yes +is_a(class_g, if_b) yes +is_a(class_g, if_c) yes +is_a(class_g, if_d) yes +is_a(class_g, if_e) no +===DONE=== diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt new file mode 100644 index 0000000..e33a4da --- /dev/null +++ b/tests/classes/interface_implemented.phpt @@ -0,0 +1,103 @@ +--TEST-- +ZE2 An interface is inherited +--SKIPIF-- + +--FILE-- +_is_a('base'); + echo $this->_is_a('derived_a'); + echo $this->_is_a('derived_b'); + echo $this->_is_a('derived_c'); + echo $this->_is_a('derived_d'); + echo $this->_is_a('if_a'); + echo $this->_is_a('if_b'); + echo "\n"; + } +} + +class derived_a extends base implements if_a { + function f_a() {} +} + +class derived_b extends base implements if_a, if_b { + function f_a() {} + function f_b() {} +} + +class derived_c extends derived_a implements if_b { + function f_b() {} +} + +class derived_d extends derived_c { +} + +$t = new base(); +$t->test(); + +$t = new derived_a(); +$t->test(); + +$t = new derived_b(); +$t->test(); + +$t = new derived_c(); +$t->test(); + +$t = new derived_d(); +$t->test(); + +?> +--EXPECTF-- +is_a(base, base) = yes +is_a(base, derived_a) = no +is_a(base, derived_b) = no +is_a(base, derived_c) = no +is_a(base, derived_d) = no +is_a(base, if_a) = no +is_a(base, if_b) = no + +is_a(derived_a, base) = yes +is_a(derived_a, derived_a) = yes +is_a(derived_a, derived_b) = no +is_a(derived_a, derived_c) = no +is_a(derived_a, derived_d) = no +is_a(derived_a, if_a) = yes +is_a(derived_a, if_b) = no + +is_a(derived_b, base) = yes +is_a(derived_b, derived_a) = no +is_a(derived_b, derived_b) = yes +is_a(derived_b, derived_c) = no +is_a(derived_b, derived_d) = no +is_a(derived_b, if_a) = yes +is_a(derived_b, if_b) = yes + +is_a(derived_c, base) = yes +is_a(derived_c, derived_a) = yes +is_a(derived_c, derived_b) = no +is_a(derived_c, derived_c) = yes +is_a(derived_c, derived_d) = no +is_a(derived_c, if_a) = yes +is_a(derived_c, if_b) = yes + +is_a(derived_d, base) = yes +is_a(derived_d, derived_a) = yes +is_a(derived_d, derived_b) = no +is_a(derived_d, derived_c) = yes +is_a(derived_d, derived_d) = yes +is_a(derived_d, if_a) = yes +is_a(derived_d, if_b) = yes diff --git a/tests/classes/interface_instantiate.phpt b/tests/classes/interface_instantiate.phpt new file mode 100644 index 0000000..61c4e6b --- /dev/null +++ b/tests/classes/interface_instantiate.phpt @@ -0,0 +1,16 @@ +--TEST-- +ZE2 An interface cannot be instantiated +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Cannot instantiate interface if_a in %s on line %d diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt new file mode 100644 index 0000000..329c072 --- /dev/null +++ b/tests/classes/interface_member.phpt @@ -0,0 +1,13 @@ +--TEST-- +ZE2 An interface cannot have properties +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Interfaces may not include member variables in %s on line %d diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt new file mode 100644 index 0000000..3570b35 --- /dev/null +++ b/tests/classes/interface_method.phpt @@ -0,0 +1,15 @@ +--TEST-- +ZE2 An interface method must be abstract +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Interface function if_a::err() cannot contain body %s on line %d diff --git a/tests/classes/interface_method_final.phpt b/tests/classes/interface_method_final.phpt new file mode 100644 index 0000000..01e599c --- /dev/null +++ b/tests/classes/interface_method_final.phpt @@ -0,0 +1,15 @@ +--TEST-- +ZE2 An interface method cannot be final +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt new file mode 100644 index 0000000..aa46a03 --- /dev/null +++ b/tests/classes/interface_method_private.phpt @@ -0,0 +1,15 @@ +--TEST-- +ZE2 An interface method cannot be private +--SKIPIF-- + +--FILE-- + +--EXPECTF-- + +Fatal error: Access type for interface method if_a::err() must be omitted in %s on line %d diff --git a/tests/classes/interface_must_be_implemented.phpt b/tests/classes/interface_must_be_implemented.phpt new file mode 100644 index 0000000..a4d7970 --- /dev/null +++ b/tests/classes/interface_must_be_implemented.phpt @@ -0,0 +1,17 @@ +--TEST-- +ZE2 An interface must be implemented +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Class derived_a contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (if_a::f_a) in %s on line %d diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt new file mode 100644 index 0000000..05f2fc4 --- /dev/null +++ b/tests/classes/interface_optional_arg.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 An interface method allows additional default arguments +--SKIPIF-- + +--FILE-- +bar(); + +?> +--EXPECT-- +foo + diff --git a/tests/classes/interface_optional_arg_002.phpt b/tests/classes/interface_optional_arg_002.phpt new file mode 100644 index 0000000..92980f6 --- /dev/null +++ b/tests/classes/interface_optional_arg_002.phpt @@ -0,0 +1,24 @@ +--TEST-- +default argument value in interface implementation +--SKIPIF-- + +--FILE-- +bar(); + +?> +--EXPECT-- +int(2) \ No newline at end of file diff --git a/tests/classes/interface_optional_arg_003.inc b/tests/classes/interface_optional_arg_003.inc new file mode 100644 index 0000000..a62c656 --- /dev/null +++ b/tests/classes/interface_optional_arg_003.inc @@ -0,0 +1,4 @@ +f(); +?> +--EXPECTF-- +int(2) \ No newline at end of file diff --git a/tests/classes/interfaces_001.phpt b/tests/classes/interfaces_001.phpt new file mode 100644 index 0000000..41e1f67 --- /dev/null +++ b/tests/classes/interfaces_001.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 interfaces +--SKIPIF-- + +--FILE-- +foo; + } +} + +$foo = new Exception_foo; +echo $foo->getMessage() . "\n"; + +?> +--EXPECT-- +foo + diff --git a/tests/classes/interfaces_002.phpt b/tests/classes/interfaces_002.phpt new file mode 100644 index 0000000..d26b534 --- /dev/null +++ b/tests/classes/interfaces_002.phpt @@ -0,0 +1,29 @@ +--TEST-- +ZE2 interface with an unimplemented method +--SKIPIF-- + +--FILE-- +foo; + } +} + +// this should die -- Exception class must be abstract... +$foo = new Exception_foo; +echo "Message: " . $foo->getMessage() . "\n"; + +?> +===DONE=== +--EXPECTF-- + +Fatal error: Class Exception_foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Throwable::getErrno) in %s on line %d diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt new file mode 100644 index 0000000..f9ab92b --- /dev/null +++ b/tests/classes/interfaces_003.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 interface and __construct +--FILE-- + +===DONE=== +--EXPECTF-- + +Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d diff --git a/tests/classes/iterators_001.phpt b/tests/classes/iterators_001.phpt new file mode 100644 index 0000000..02e3610 --- /dev/null +++ b/tests/classes/iterators_001.phpt @@ -0,0 +1,200 @@ +--TEST-- +ZE2 iterators and foreach +--SKIPIF-- + +--FILE-- +num = 0; + $this->obj = $obj; + } + function rewind() { + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } +} + +class c implements IteratorAggregate { + + public $max = 3; + + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } +} + +echo "===Array===\n"; + +$a = array(0,1,2); +foreach($a as $v) { + echo "array:$v\n"; +} + +echo "===Manual===\n"; +$t = new c(); +for ($iter = $t->getIterator(); $iter->valid(); $iter->next()) { + echo $iter->current() . "\n"; +} + +echo "===foreach/std===\n"; +foreach($t as $v) { + echo "object:$v\n"; +} + +echo "===foreach/rec===\n"; +foreach($t as $v) { + foreach($t as $w) { + echo "double:$v:$w\n"; + } +} + +echo "===foreach/key===\n"; +foreach($t as $i => $v) { + echo "object:$i=>$v\n"; +} + +print "Done\n"; +exit(0); +?> +--EXPECT-- +===Array=== +array:0 +array:1 +array:2 +===Manual=== +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +0 +c_iter::next +c_iter::valid = true +c_iter::current +1 +c_iter::next +c_iter::valid = true +c_iter::current +2 +c_iter::next +c_iter::valid = false +===foreach/std=== +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +object:0 +c_iter::next +c_iter::valid = true +c_iter::current +object:1 +c_iter::next +c_iter::valid = true +c_iter::current +object:2 +c_iter::next +c_iter::valid = false +===foreach/rec=== +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +double:0:0 +c_iter::next +c_iter::valid = true +c_iter::current +double:0:1 +c_iter::next +c_iter::valid = true +c_iter::current +double:0:2 +c_iter::next +c_iter::valid = false +c_iter::next +c_iter::valid = true +c_iter::current +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +double:1:0 +c_iter::next +c_iter::valid = true +c_iter::current +double:1:1 +c_iter::next +c_iter::valid = true +c_iter::current +double:1:2 +c_iter::next +c_iter::valid = false +c_iter::next +c_iter::valid = true +c_iter::current +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +double:2:0 +c_iter::next +c_iter::valid = true +c_iter::current +double:2:1 +c_iter::next +c_iter::valid = true +c_iter::current +double:2:2 +c_iter::next +c_iter::valid = false +c_iter::next +c_iter::valid = false +===foreach/key=== +c::getIterator +c_iter::__construct +c_iter::valid = true +c_iter::current +c_iter::key +object:1st=>0 +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +object:2nd=>1 +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +object:3rd=>2 +c_iter::next +c_iter::valid = false +Done diff --git a/tests/classes/iterators_002.phpt b/tests/classes/iterators_002.phpt new file mode 100644 index 0000000..4a58be0 --- /dev/null +++ b/tests/classes/iterators_002.phpt @@ -0,0 +1,113 @@ +--TEST-- +ZE2 iterators and break +--SKIPIF-- + +--FILE-- +obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + $this->num = 0; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } + function __destruct() { + echo __METHOD__ . "\n"; + } +} + +class c implements IteratorAggregate { + + public $max = 3; + + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } + function __destruct() { + echo __METHOD__ . "\n"; + } +} + +$t = new c(); + +foreach($t as $k => $v) { + foreach($t as $w) { + echo "double:$v:$w\n"; + break; + } +} + +unset($t); + +print "Done\n"; +?> +--EXPECT-- +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:0:0 +c_iter::__destruct +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:1:0 +c_iter::__destruct +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:2:0 +c_iter::__destruct +c_iter::next +c_iter::valid = false +c_iter::__destruct +c::__destruct +Done diff --git a/tests/classes/iterators_003.phpt b/tests/classes/iterators_003.phpt new file mode 100644 index 0000000..42695db --- /dev/null +++ b/tests/classes/iterators_003.phpt @@ -0,0 +1,115 @@ +--TEST-- +ZE2 iterators and break +--SKIPIF-- + +--FILE-- +obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + return $this->num; + } +} + +class c implements IteratorAggregate { + + public $max = 4; + + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } +} + +$t = new c(); + +foreach($t as $v) { + if ($v == 0) { + echo "continue outer\n"; + continue; + } + foreach($t as $w) { + if ($w == 1) { + echo "continue inner\n"; + continue; + } + if ($w == 2) { + echo "break inner\n"; + break; + } + echo "double:$v:$w\n"; + } + if ($v == 2) { + echo "break outer\n"; + break; + } +} + +print "Done\n"; +?> +--EXPECT-- +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +continue outer +c_iter::next +c_iter::valid = true +c_iter::current +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:1:0 +c_iter::next +c_iter::valid = true +c_iter::current +continue inner +c_iter::next +c_iter::valid = true +c_iter::current +break inner +c_iter::next +c_iter::valid = true +c_iter::current +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:2:0 +c_iter::next +c_iter::valid = true +c_iter::current +continue inner +c_iter::next +c_iter::valid = true +c_iter::current +break inner +break outer +Done diff --git a/tests/classes/iterators_004.phpt b/tests/classes/iterators_004.phpt new file mode 100644 index 0000000..3fe0527 --- /dev/null +++ b/tests/classes/iterators_004.phpt @@ -0,0 +1,61 @@ +--TEST-- +ZE2 iterators must be implemented +--SKIPIF-- + +--FILE-- +num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function valid() { + echo __METHOD__ . "\n"; + return $this->num < $this->max; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } +} + +$obj = new c2(); + +foreach($obj as $v => $w) { + echo "object:$v=>$w\n"; +} + +print "Done\n"; +?> +--EXPECTF-- +1st try +2nd try +object:max=>3 +object:num=>0 +Done diff --git a/tests/classes/iterators_005.phpt b/tests/classes/iterators_005.phpt new file mode 100644 index 0000000..005deb9 --- /dev/null +++ b/tests/classes/iterators_005.phpt @@ -0,0 +1,19 @@ +--TEST-- +ZE2 iterators cannot implement Traversable alone +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Class test must implement interface Traversable as part of either Iterator or IteratorAggregate in %s on line %d diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt new file mode 100644 index 0000000..47fa690 --- /dev/null +++ b/tests/classes/iterators_006.phpt @@ -0,0 +1,87 @@ +--TEST-- +ZE2 iterators and array wrapping +--SKIPIF-- + +--FILE-- +array = array('foo', 'bar', 'baz'); + } + + function rewind() { + reset($this->array); + $this->next(); + } + + function valid() { + return $this->key !== NULL; + } + + function key() { + return $this->key; + } + + function current() { + return $this->current; + } + + function next() { + list($this->key, $this->current) = each($this->array); +// list($key, $current) = each($this->array); +// $this->key = $key; +// $this->current = $current; + } +} + +class a implements IteratorAggregate { + + public function getIterator() { + return new ai(); + } +} + +$array = new a(); + +foreach ($array as $property => $value) { + print "$property: $value\n"; +} + +#$array = $array->getIterator(); +#$array->rewind(); +#$array->valid(); +#var_dump($array->key()); +#var_dump($array->current()); +echo "===2nd===\n"; + +$array = new ai(); + +foreach ($array as $property => $value) { + print "$property: $value\n"; +} + +echo "===3rd===\n"; + +foreach ($array as $property => $value) { + print "$property: $value\n"; +} + +?> +===DONE=== +--EXPECT-- +0: foo +1: bar +2: baz +===2nd=== +0: foo +1: bar +2: baz +===3rd=== +0: foo +1: bar +2: baz +===DONE=== \ No newline at end of file diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt new file mode 100644 index 0000000..f2638b3 --- /dev/null +++ b/tests/classes/iterators_007.phpt @@ -0,0 +1,43 @@ +--TEST-- +ZE2 iterators and exceptions +--FILE-- +x == 0) throw new Exception(__METHOD__); reset($this->arr); } + public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); } + public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); } + public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); } + public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); } +} + +$t = new Test(); + +while($t->x < 5) +{ + try + { + foreach($t as $k => $v) + { + echo "Current\n"; + } + } + catch(Exception $e) + { + echo "Caught in " . $e->getMessage() . "()\n"; + } + $t->x++; +} +?> +===DONE=== +--EXPECT-- +Caught in Test::rewind() +Caught in Test::current() +Caught in Test::key() +Current +Caught in Test::next() +Caught in Test::valid() +===DONE=== diff --git a/tests/classes/iterators_008.phpt b/tests/classes/iterators_008.phpt new file mode 100644 index 0000000..22e6dc8 --- /dev/null +++ b/tests/classes/iterators_008.phpt @@ -0,0 +1,45 @@ +--TEST-- +Ensure plain userspace superclass does not override special iterator behaviour on child class. +--FILE-- +counter)\n"; + return $this->counter; + } + + public function next() { + $this->counter--; + echo __METHOD__ . "($this->counter)\n"; + } + + public function rewind() { + echo __METHOD__ . "($this->counter)\n"; + } + + public function current() { + echo __METHOD__ . "($this->counter)\n"; + } + + public function key() { + echo __METHOD__ . "($this->counter)\n"; + } + +} + +foreach (new D as $x) {} +?> +--EXPECTF-- +D::rewind(2) +D::valid(2) +D::current(2) +D::next(1) +D::valid(1) +D::current(1) +D::next(0) +D::valid(0) \ No newline at end of file diff --git a/tests/classes/method_call_variation_001.phpt b/tests/classes/method_call_variation_001.phpt new file mode 100644 index 0000000..dd43cfd --- /dev/null +++ b/tests/classes/method_call_variation_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +In $a->$b[Y](), $b[Y] represents a method name on $a. But in $a->X[Y](), $a->X[Y] represents a global function name. +--FILE-- +$functions[0](1, 2); + $c->$functions[1][2][3][4](3, 4); + + + function foo($a, $b) + { + echo "Called global foo($a, $b)\n"; + } + + $c->functions[0] = 'foo'; + $c->functions[1][2][3][4] = 'foo'; + + $c->functions[0](5, 6); + $c->functions[1][2][3][4](7, 8); +?> +--EXPECTF-- +Called C::foo(1, 2) +Called C::foo(3, 4) +Called global foo(5, 6) +Called global foo(7, 8) diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt new file mode 100644 index 0000000..333c29d --- /dev/null +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -0,0 +1,33 @@ +--TEST-- +Method override allows optional default argument +--SKIPIF-- + +--FILE-- +foo(1); + +?> +--EXPECTF-- +Strict Standards: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d +int(1) +int(3) diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt new file mode 100644 index 0000000..669a8ca --- /dev/null +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -0,0 +1,22 @@ +--TEST-- +Omitting optional arg in method inherited from abstract class +--FILE-- +foo(); + +?> +--EXPECTF-- +Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d +foo diff --git a/tests/classes/new_001.phpt b/tests/classes/new_001.phpt new file mode 100644 index 0000000..ee7d352 --- /dev/null +++ b/tests/classes/new_001.phpt @@ -0,0 +1,48 @@ +--TEST-- +Confirm difference between assigning new directly and by reference. +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +id = ++Inc::$counter; + } + } + + $f = new Inc(); + $k =& $f; + echo "\$f initially points to the first object:\n"; + var_dump($f); + + echo "Assigning new object directly to \$k affects \$f:\n"; + $k = new Inc(); + var_dump($f); + + echo "Assigning new object by ref to \$k removes it from \$f's reference set, so \$f is unchanged:\n"; + $k =& new Inc(); + var_dump($f); +?> +--EXPECTF-- +Deprecated: Assigning the return value of new by reference is deprecated in %s on line 23 +Compile-time strict error message should precede this. +$f initially points to the first object: +object(Inc)#%d (1) { + ["id"]=> + int(1) +} +Assigning new object directly to $k affects $f: +object(Inc)#%d (1) { + ["id"]=> + int(2) +} +Assigning new object by ref to $k removes it from $f's reference set, so $f is unchanged: +object(Inc)#%d (1) { + ["id"]=> + int(2) +} diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt new file mode 100644 index 0000000..74acb5d --- /dev/null +++ b/tests/classes/object_reference_001.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 object references +--SKIPIF-- + +--FILE-- +name = "I'm Foo!\n"; + } +} + +$foo = new Foo; +echo $foo->name; +$bar = $foo; +$bar->name = "I'm Bar!\n"; + +// In ZE1, we would expect "I'm Foo!" +echo $foo->name; + +?> +--EXPECT-- +I'm Foo! +I'm Bar! diff --git a/tests/classes/private_001.phpt b/tests/classes/private_001.phpt new file mode 100644 index 0000000..310b9c6 --- /dev/null +++ b/tests/classes/private_001.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 A private method can only be called inside the class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context '' in %s on line %d diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt new file mode 100644 index 0000000..258fd3a --- /dev/null +++ b/tests/classes/private_002.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 A private method cannot be called in another class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call pass::show() +Call fail::show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt new file mode 100644 index 0000000..716efbc --- /dev/null +++ b/tests/classes/private_003.phpt @@ -0,0 +1,36 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt new file mode 100644 index 0000000..780b2e6 --- /dev/null +++ b/tests/classes/private_003b.phpt @@ -0,0 +1,37 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- +show(); + } +} + +class fail extends pass { + public function ok() { + $this->good(); + } + + public function not_ok() { + $this->show(); + } +} + +$t = new fail(); +$t->ok(); +$t->not_ok(); // calling a private function + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt new file mode 100644 index 0000000..027434a --- /dev/null +++ b/tests/classes/private_004.phpt @@ -0,0 +1,32 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt new file mode 100644 index 0000000..ea3fe61 --- /dev/null +++ b/tests/classes/private_004b.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- +show(); + } +} + +class fail extends pass { + function do_show() { + $this->show(); + } +} + +$t = new pass(); +$t->do_show(); + +$t2 = new fail(); +$t2->do_show(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt new file mode 100644 index 0000000..49b2bee --- /dev/null +++ b/tests/classes/private_005.phpt @@ -0,0 +1,32 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/private_005b.phpt b/tests/classes/private_005b.phpt new file mode 100644 index 0000000..ea3fe61 --- /dev/null +++ b/tests/classes/private_005b.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 A private method cannot be called in a derived class +--SKIPIF-- + +--FILE-- +show(); + } +} + +class fail extends pass { + function do_show() { + $this->show(); + } +} + +$t = new pass(); +$t->do_show(); + +$t2 = new fail(); +$t2->do_show(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call show() + +Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file diff --git a/tests/classes/private_006.phpt b/tests/classes/private_006.phpt new file mode 100644 index 0000000..0bb2b3f --- /dev/null +++ b/tests/classes/private_006.phpt @@ -0,0 +1,41 @@ +--TEST-- +ZE2 A private method can be overwritten in a second derived class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call show() +Call show() +Call show() +Done diff --git a/tests/classes/private_006b.phpt b/tests/classes/private_006b.phpt new file mode 100644 index 0000000..950f16a --- /dev/null +++ b/tests/classes/private_006b.phpt @@ -0,0 +1,41 @@ +--TEST-- +ZE2 A private method can be overwritten in a second derived class +--SKIPIF-- + +--FILE-- +show(); + } +} + +$t1 = new first(); +$t1->do_show(); + +class second extends first { +} + +//$t2 = new second(); +//$t2->do_show(); + +class third extends second { + private function show() { + echo "Call show()\n"; + } +} + +$t3 = new third(); +$t3->do_show(); + +echo "Done\n"; +?> +--EXPECTF-- +Call show() +Call show() +Done \ No newline at end of file diff --git a/tests/classes/private_007.phpt b/tests/classes/private_007.phpt new file mode 100644 index 0000000..73a38c4 --- /dev/null +++ b/tests/classes/private_007.phpt @@ -0,0 +1,30 @@ +--TEST-- +ZE2 A derived class does not know about privates of ancestors +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Bar::priv() +Foo::priv() +Done diff --git a/tests/classes/private_007b.phpt b/tests/classes/private_007b.phpt new file mode 100644 index 0000000..02ddc25 --- /dev/null +++ b/tests/classes/private_007b.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 A derived class does not know about privates of ancestors +--SKIPIF-- + +--FILE-- +priv(); + } + private function priv() { + echo "Bar::priv()\n"; + } +} +class Foo extends Bar { + public function priv() { + echo "Foo::priv()\n"; + } +} + +$obj = new Foo(); +$obj->pub(); +$obj->priv(); + +echo "Done\n"; +?> +--EXPECTF-- +Bar::priv() +Foo::priv() +Done diff --git a/tests/classes/private_members.phpt b/tests/classes/private_members.phpt new file mode 100644 index 0000000..a8ef9ab --- /dev/null +++ b/tests/classes/private_members.phpt @@ -0,0 +1,103 @@ +--TEST-- +ZE2 A private member is +--SKIPIF-- + +--FILE-- +member = 'base::member'; + $this->test(); + echo __METHOD__ . "(end)\n"; + } + + function test() + { + echo __METHOD__ . "\n"; + print_r($this); + } +} + +class derived extends base +{ + public $member = 'derived::member (default)'; + + function __construct() + { + echo __METHOD__ . "(begin)\n"; + parent::__construct(); + parent::test(); + $this->test(); + $this->member = 'derived::member'; + echo __METHOD__ . "(end)\n"; + } + + function test() + { + parent::test(); + echo __METHOD__ . "\n"; + print_r($this); + } +} + +$t = new derived; +$t->test(); +unset($t); + +echo "Done\n"; + +?> +--EXPECTF-- +derived::__construct(begin) +base::__construct(begin) +base::test +derived Object +( + [member] => derived::member (default) + [member:base:private] => base::member +) +derived::test +derived Object +( + [member] => derived::member (default) + [member:base:private] => base::member +) +base::__construct(end) +base::test +derived Object +( + [member] => derived::member (default) + [member:base:private] => base::member +) +base::test +derived Object +( + [member] => derived::member (default) + [member:base:private] => base::member +) +derived::test +derived Object +( + [member] => derived::member (default) + [member:base:private] => base::member +) +derived::__construct(end) +base::test +derived Object +( + [member] => derived::member + [member:base:private] => base::member +) +derived::test +derived Object +( + [member] => derived::member + [member:base:private] => base::member +) +Done diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt new file mode 100644 index 0000000..e3061f1 --- /dev/null +++ b/tests/classes/private_redeclare.phpt @@ -0,0 +1,38 @@ +--TEST-- +ZE2 A derived class does not know anything about inherited private methods +--FILE-- +show(); + } +} + +$t = new base(); +$t->test(); + +class derived extends base { + function show() { + echo "derived\n"; + } + function test() { + echo "test\n"; + $this->show(); + parent::test(); + parent::show(); + } +} + +$t = new derived(); +$t->test(); +?> +--EXPECTF-- +base +test +derived +base + +Fatal error: Call to private method base::show() from context 'derived' in %s on line %d diff --git a/tests/classes/property_override_privateStatic_private.phpt b/tests/classes/property_override_privateStatic_private.phpt new file mode 100644 index 0000000..ddd2e5d --- /dev/null +++ b/tests/classes/property_override_privateStatic_private.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited private static property as private. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p (static) +A::p (static) +B::p diff --git a/tests/classes/property_override_privateStatic_privateStatic.phpt b/tests/classes/property_override_privateStatic_privateStatic.phpt new file mode 100644 index 0000000..d7d645f --- /dev/null +++ b/tests/classes/property_override_privateStatic_privateStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited private static property as private static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) diff --git a/tests/classes/property_override_privateStatic_protected.phpt b/tests/classes/property_override_privateStatic_protected.phpt new file mode 100644 index 0000000..d473216 --- /dev/null +++ b/tests/classes/property_override_privateStatic_protected.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited private static property as protected. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p (static) +A::p (static) +B::p diff --git a/tests/classes/property_override_privateStatic_protectedStatic.phpt b/tests/classes/property_override_privateStatic_protectedStatic.phpt new file mode 100644 index 0000000..169ff9a --- /dev/null +++ b/tests/classes/property_override_privateStatic_protectedStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited private static property as protected static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) diff --git a/tests/classes/property_override_privateStatic_public.phpt b/tests/classes/property_override_privateStatic_public.phpt new file mode 100644 index 0000000..033eb75 --- /dev/null +++ b/tests/classes/property_override_privateStatic_public.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited private static property as public. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p (static) +A::p (static) +B::p diff --git a/tests/classes/property_override_privateStatic_publicStatic.phpt b/tests/classes/property_override_privateStatic_publicStatic.phpt new file mode 100644 index 0000000..5f2b6bf --- /dev/null +++ b/tests/classes/property_override_privateStatic_publicStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited private static property as public static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) diff --git a/tests/classes/property_override_private_private.phpt b/tests/classes/property_override_private_private.phpt new file mode 100644 index 0000000..2b263ee --- /dev/null +++ b/tests/classes/property_override_private_private.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as private. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +A::p +B::p diff --git a/tests/classes/property_override_private_privateStatic.phpt b/tests/classes/property_override_private_privateStatic.phpt new file mode 100644 index 0000000..606ed21 --- /dev/null +++ b/tests/classes/property_override_private_privateStatic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as private static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- +A::p +A::p +B::p (static) diff --git a/tests/classes/property_override_private_protected.phpt b/tests/classes/property_override_private_protected.phpt new file mode 100644 index 0000000..b84ed67 --- /dev/null +++ b/tests/classes/property_override_private_protected.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as protected. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +A::p +B::p diff --git a/tests/classes/property_override_private_protectedStatic.phpt b/tests/classes/property_override_private_protectedStatic.phpt new file mode 100644 index 0000000..1bb303d --- /dev/null +++ b/tests/classes/property_override_private_protectedStatic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as protected static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- +A::p +A::p +B::p (static) diff --git a/tests/classes/property_override_private_public.phpt b/tests/classes/property_override_private_public.phpt new file mode 100644 index 0000000..badbe91 --- /dev/null +++ b/tests/classes/property_override_private_public.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as public. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +A::p +B::p diff --git a/tests/classes/property_override_private_publicStatic.phpt b/tests/classes/property_override_private_publicStatic.phpt new file mode 100644 index 0000000..9fc58ec --- /dev/null +++ b/tests/classes/property_override_private_publicStatic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited private property as public static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- +A::p +A::p +B::p (static) diff --git a/tests/classes/property_override_protectedStatic_private.phpt b/tests/classes/property_override_protectedStatic_private.phpt new file mode 100644 index 0000000..18e9c78 --- /dev/null +++ b/tests/classes/property_override_protectedStatic_private.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected static property as private. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_protectedStatic_privateStatic.phpt b/tests/classes/property_override_protectedStatic_privateStatic.phpt new file mode 100644 index 0000000..6886210 --- /dev/null +++ b/tests/classes/property_override_protectedStatic_privateStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited protected static property as private static. +--FILE-- + +--EXPECTF-- + +Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18 + diff --git a/tests/classes/property_override_protectedStatic_protected.phpt b/tests/classes/property_override_protectedStatic_protected.phpt new file mode 100644 index 0000000..0e5fdd3 --- /dev/null +++ b/tests/classes/property_override_protectedStatic_protected.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected static property as protected. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_protectedStatic_protectedStatic.phpt b/tests/classes/property_override_protectedStatic_protectedStatic.phpt new file mode 100644 index 0000000..16f1100 --- /dev/null +++ b/tests/classes/property_override_protectedStatic_protectedStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited protected static property as protected static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) diff --git a/tests/classes/property_override_protectedStatic_public.phpt b/tests/classes/property_override_protectedStatic_public.phpt new file mode 100644 index 0000000..6303325 --- /dev/null +++ b/tests/classes/property_override_protectedStatic_public.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected static property as public. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_protectedStatic_publicStatic.phpt b/tests/classes/property_override_protectedStatic_publicStatic.phpt new file mode 100644 index 0000000..e437c5f --- /dev/null +++ b/tests/classes/property_override_protectedStatic_publicStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected static property as public static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) + diff --git a/tests/classes/property_override_protected_private.phpt b/tests/classes/property_override_protected_private.phpt new file mode 100644 index 0000000..22cceda --- /dev/null +++ b/tests/classes/property_override_protected_private.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected property as private (duplicates Zend/tests/errmsg_023.phpt). +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18 diff --git a/tests/classes/property_override_protected_privateStatic.phpt b/tests/classes/property_override_protected_privateStatic.phpt new file mode 100644 index 0000000..fb7102c --- /dev/null +++ b/tests/classes/property_override_protected_privateStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected property as private static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_protected_protected.phpt b/tests/classes/property_override_protected_protected.phpt new file mode 100644 index 0000000..c4b0d43 --- /dev/null +++ b/tests/classes/property_override_protected_protected.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited protected property as protected. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +B::p +B::p diff --git a/tests/classes/property_override_protected_protectedStatic.phpt b/tests/classes/property_override_protected_protectedStatic.phpt new file mode 100644 index 0000000..1ce4130 --- /dev/null +++ b/tests/classes/property_override_protected_protectedStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected property as protected static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_protected_public.phpt b/tests/classes/property_override_protected_public.phpt new file mode 100644 index 0000000..4702f9a --- /dev/null +++ b/tests/classes/property_override_protected_public.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited protected property as public. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +B::p +B::p diff --git a/tests/classes/property_override_protected_publicStatic.phpt b/tests/classes/property_override_protected_publicStatic.phpt new file mode 100644 index 0000000..8efdf5f --- /dev/null +++ b/tests/classes/property_override_protected_publicStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited protected property as public static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_publicStatic_private.phpt b/tests/classes/property_override_publicStatic_private.phpt new file mode 100644 index 0000000..7abe92c --- /dev/null +++ b/tests/classes/property_override_publicStatic_private.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public static property as private. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_publicStatic_privateStatic.phpt b/tests/classes/property_override_publicStatic_privateStatic.phpt new file mode 100644 index 0000000..d41db6d --- /dev/null +++ b/tests/classes/property_override_publicStatic_privateStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited public static property as private static. +--FILE-- + +--EXPECTF-- + +Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 + diff --git a/tests/classes/property_override_publicStatic_protected.phpt b/tests/classes/property_override_publicStatic_protected.phpt new file mode 100644 index 0000000..884159f --- /dev/null +++ b/tests/classes/property_override_publicStatic_protected.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public static property as protected. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_publicStatic_protectedStatic.phpt b/tests/classes/property_override_publicStatic_protectedStatic.phpt new file mode 100644 index 0000000..b022ef8 --- /dev/null +++ b/tests/classes/property_override_publicStatic_protectedStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited public static property as protected static. +--FILE-- + +--EXPECTF-- + +Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 + diff --git a/tests/classes/property_override_publicStatic_public.phpt b/tests/classes/property_override_publicStatic_public.phpt new file mode 100644 index 0000000..d099da0 --- /dev/null +++ b/tests/classes/property_override_publicStatic_public.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public static property as public. +--FILE-- +p . "\n"; + } + } + + + A::showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18 + diff --git a/tests/classes/property_override_publicStatic_publicStatic.phpt b/tests/classes/property_override_publicStatic_publicStatic.phpt new file mode 100644 index 0000000..9a86867 --- /dev/null +++ b/tests/classes/property_override_publicStatic_publicStatic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Redeclare inherited public static property as public static. +--FILE-- + +--EXPECTF-- +A::p (static) +A::p (static) +B::p (static) diff --git a/tests/classes/property_override_public_private.phpt b/tests/classes/property_override_public_private.phpt new file mode 100644 index 0000000..c0f37ad --- /dev/null +++ b/tests/classes/property_override_public_private.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited public property as private. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 + diff --git a/tests/classes/property_override_public_privateStatic.phpt b/tests/classes/property_override_public_privateStatic.phpt new file mode 100644 index 0000000..36223fd --- /dev/null +++ b/tests/classes/property_override_public_privateStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public property as private static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + private static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_public_protected.phpt b/tests/classes/property_override_public_protected.phpt new file mode 100644 index 0000000..68fdf82 --- /dev/null +++ b/tests/classes/property_override_public_protected.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited public property as protected. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- + +Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18 + diff --git a/tests/classes/property_override_public_protectedStatic.phpt b/tests/classes/property_override_public_protectedStatic.phpt new file mode 100644 index 0000000..77e7ebf --- /dev/null +++ b/tests/classes/property_override_public_protectedStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public property as protected static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + protected static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_override_public_public.phpt b/tests/classes/property_override_public_public.phpt new file mode 100644 index 0000000..893fe5d --- /dev/null +++ b/tests/classes/property_override_public_public.phpt @@ -0,0 +1,34 @@ +--TEST-- +Redeclare inherited public property as public. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public $p = "B::p"; + function showB() + { + echo $this->p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + $b->showB(); +?> +--EXPECTF-- +A::p +B::p +B::p diff --git a/tests/classes/property_override_public_publicStatic.phpt b/tests/classes/property_override_public_publicStatic.phpt new file mode 100644 index 0000000..725e947 --- /dev/null +++ b/tests/classes/property_override_public_publicStatic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Redeclare inherited public property as public static. +--FILE-- +p . "\n"; + } + } + + class B extends A + { + public static $p = "B::p (static)"; + static function showB() + { + echo self::$p . "\n"; + } + } + + + $a = new A; + $a->showA(); + + $b = new B; + $b->showA(); + B::showB(); +?> +--EXPECTF-- + +Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18 diff --git a/tests/classes/property_recreate_private.phpt b/tests/classes/property_recreate_private.phpt new file mode 100644 index 0000000..8bcf485 --- /dev/null +++ b/tests/classes/property_recreate_private.phpt @@ -0,0 +1,81 @@ +--TEST-- +Unsetting and recreating private properties. +--FILE-- +p); + } + function setPrivate() { + $this->p = 'changed'; + } +} + +class D extends C { + function setP() { + $this->p = 'changed in D'; + } +} + +echo "Unset and recreate a superclass's private property:\n"; +$d = new D; +$d->unsetPrivate(); +$d->setPrivate(); +var_dump($d); + +echo "\nUnset superclass's private property, and recreate it as public in subclass:\n"; +$d = new D; +$d->unsetPrivate(); +$d->setP(); +var_dump($d); + +echo "\nUnset superclass's private property, and recreate it as public at global scope:\n"; +$d = new D; +$d->unsetPrivate(); +$d->p = 'this will create a public property'; +var_dump($d); + + +echo "\n\nUnset and recreate a private property:\n"; +$c = new C; +$c->unsetPrivate(); +$c->setPrivate(); +var_dump($c); + +echo "\nUnset a private property, and attempt to recreate at global scope (expecting failure):\n"; +$c = new C; +$c->unsetPrivate(); +$c->p = 'this will fail'; +var_dump($c); +?> +==Done== +--EXPECTF-- +Unset and recreate a superclass's private property: +object(D)#%d (1) { + [%u|b%"p":%u|b%"C":private]=> + %unicode|string%(7) "changed" +} + +Unset superclass's private property, and recreate it as public in subclass: +object(D)#%d (1) { + [%u|b%"p"]=> + %unicode|string%(12) "changed in D" +} + +Unset superclass's private property, and recreate it as public at global scope: +object(D)#%d (1) { + [%u|b%"p"]=> + %unicode|string%(34) "this will create a public property" +} + + +Unset and recreate a private property: +object(C)#%d (1) { + [%u|b%"p":%u|b%"C":private]=> + %unicode|string%(7) "changed" +} + +Unset a private property, and attempt to recreate at global scope (expecting failure): + +Fatal error: Cannot access private property C::$p in %s on line 46 \ No newline at end of file diff --git a/tests/classes/property_recreate_protected.phpt b/tests/classes/property_recreate_protected.phpt new file mode 100644 index 0000000..4da4de8 --- /dev/null +++ b/tests/classes/property_recreate_protected.phpt @@ -0,0 +1,53 @@ +--TEST-- +Unsetting and recreating protected properties. +--FILE-- +p); + } + function setProtected() { + $this->p = 'changed'; + } +} + +class D extends C { + function setP() { + $this->p = 'changed in D'; + } +} + +$d = new D; +echo "Unset and recreate a protected property from property's declaring class scope:\n"; +$d->unsetProtected(); +$d->setProtected(); +var_dump($d); + +echo "\nUnset and recreate a protected property from subclass:\n"; +$d = new D; +$d->unsetProtected(); +$d->setP(); +var_dump($d); + +echo "\nUnset a protected property, and attempt to recreate it outside of scope (expected failure):\n"; +$d->unsetProtected(); +$d->p = 'this will fail'; +var_dump($d); +?> +--EXPECTF-- +Unset and recreate a protected property from property's declaring class scope: +object(D)#%d (1) { + [%u|b%"p":protected]=> + %unicode|string%(7) "changed" +} + +Unset and recreate a protected property from subclass: +object(D)#%d (1) { + [%u|b%"p":protected]=> + %unicode|string%(12) "changed in D" +} + +Unset a protected property, and attempt to recreate it outside of scope (expected failure): + +Fatal error: Cannot access protected property %s::$p in %s on line 32 \ No newline at end of file diff --git a/tests/classes/protected_001.phpt b/tests/classes/protected_001.phpt new file mode 100644 index 0000000..19872c6 --- /dev/null +++ b/tests/classes/protected_001.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 A protected method can only be called inside the class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call fail() + +Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt new file mode 100644 index 0000000..4d24a92 --- /dev/null +++ b/tests/classes/protected_001b.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 A protected method can only be called inside the class +--SKIPIF-- + +--FILE-- +fail(); + } +} + +$t = new pass(); +$t->good(); +$t->fail();// must fail because we are calling from outside of class pass + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Call fail() + +Fatal error: Call to protected method pass::fail() from context '' in %s on line %d diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt new file mode 100644 index 0000000..f26ef9c --- /dev/null +++ b/tests/classes/protected_002.phpt @@ -0,0 +1,35 @@ +--TEST-- +ZE2 A protected method cannot be called in another class +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Call pass::show() +Call fail::show() + +Fatal error: Call to protected method pass::show() from context 'fail' in %s on line %d diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt new file mode 100644 index 0000000..142fc50 --- /dev/null +++ b/tests/classes/serialize_001.phpt @@ -0,0 +1,79 @@ +--TEST-- +ZE2 Serializable +--FILE-- +data = $data; + } + + function serialize() + { + echo __METHOD__ . "({$this->data})\n"; + return $this->data; + } + + function unserialize($serialized) + { + echo __METHOD__ . "($serialized)\n"; + $this->data = $serialized; + var_dump($this); + } +} + +$tests = array('String', NULL, 42, false); + +foreach($tests as $data) +{ + try + { + echo "==========\n"; + var_dump($data); + $ser = serialize(new Test($data)); + var_dump(unserialize($ser)); + } + catch(Exception $e) + { + echo 'Exception: ' . $e->getMessage() . "\n"; + } +} + +?> +===DONE=== + +--EXPECTF-- +========== +%unicode|string%(6) "String" +Test::__construct(String) +Test::serialize(String) +Test::unserialize(String) +object(Test)#%d (1) { + [%u|b%"data"]=> + %unicode|string%(6) "String" +} +object(Test)#%d (1) { + [%u|b%"data"]=> + %unicode|string%(6) "String" +} +========== +NULL +Test::__construct() +Test::serialize() +NULL +========== +int(42) +Test::__construct(42) +Test::serialize(42) +Exception: Test::serialize() must return a string or NULL +========== +bool(false) +Test::__construct() +Test::serialize() +Exception: Test::serialize() must return a string or NULL +===DONE=== diff --git a/tests/classes/singleton_001.phpt b/tests/classes/singleton_001.phpt new file mode 100644 index 0000000..ee729b9 --- /dev/null +++ b/tests/classes/singleton_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +ZE2 singleton +--SKIPIF-- + +--FILE-- +counter; + echo "\n"; + } +} + + +class SingletonCounter { + private static $m_instance = NULL; + + static function Instance() { + if (self::$m_instance == NULL) { + self::$m_instance = new Counter(); + } + return self::$m_instance; + } +} + +SingletonCounter::Instance()->increment_and_print(); +SingletonCounter::Instance()->increment_and_print(); +SingletonCounter::Instance()->increment_and_print(); + +?> +--EXPECT-- +1 +2 +3 diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt new file mode 100644 index 0000000..ecc9c01 --- /dev/null +++ b/tests/classes/static_mix_1.phpt @@ -0,0 +1,26 @@ +--TEST-- +ZE2 You cannot overload a static method with a non static method +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt new file mode 100644 index 0000000..bbdaedf --- /dev/null +++ b/tests/classes/static_mix_2.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 You cannot overload a non static method with a static method +--SKIPIF-- + +--FILE-- +show(); +fail::show(); + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d \ No newline at end of file diff --git a/tests/classes/static_properties_001.phpt b/tests/classes/static_properties_001.phpt new file mode 100644 index 0000000..1c34f68 --- /dev/null +++ b/tests/classes/static_properties_001.phpt @@ -0,0 +1,27 @@ +--TEST-- +ZE2 Initializing static properties to arrays +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +array(0) { +} +array(1) { + [0]=> + int(1) +} +Done diff --git a/tests/classes/static_properties_003.phpt b/tests/classes/static_properties_003.phpt new file mode 100644 index 0000000..2441e41 --- /dev/null +++ b/tests/classes/static_properties_003.phpt @@ -0,0 +1,49 @@ +--TEST-- +Attempting to access static properties using instance property syntax +--FILE-- + Access visible static prop like instance prop:\n"; +var_dump(isset($c->x)); +unset($c->x); +echo $c->x; +$c->x = 1; +$ref = 'ref'; +$c->x =& $ref; +var_dump($c->x, C::$x); + +echo "\n--> Access non-visible static prop like instance prop:\n"; +var_dump(isset($c->y)); +//unset($c->y); // Fatal error, tested in static_properties_003_error1.phpt +//echo $c->y; // Fatal error, tested in static_properties_003_error2.phpt +//$c->y = 1; // Fatal error, tested in static_properties_003_error3.phpt +//$c->y =& $ref; // Fatal error, tested in static_properties_003_error4.phpt +?> +==Done== +--EXPECTF-- +--> Access visible static prop like instance prop: +bool(false) + +Strict Standards: Accessing static property C::$x as non static in %s on line 11 + +Strict Standards: Accessing static property C::$x as non static in %s on line 12 + +Notice: Undefined property: C::$x in %s on line 12 + +Strict Standards: Accessing static property C::$x as non static in %s on line 13 + +Strict Standards: Accessing static property C::$x as non static in %s on line 15 + +Strict Standards: Accessing static property C::$x as non static in %s on line 16 +%unicode|string%(3) "ref" +%unicode|string%(5) "C::$x" + +--> Access non-visible static prop like instance prop: +bool(false) +==Done== \ No newline at end of file diff --git a/tests/classes/static_properties_003_error1.phpt b/tests/classes/static_properties_003_error1.phpt new file mode 100644 index 0000000..7a5e3d9 --- /dev/null +++ b/tests/classes/static_properties_003_error1.phpt @@ -0,0 +1,18 @@ +--TEST-- +Attempting to access static properties using instance property syntax +--FILE-- + Access non-visible static prop like instance prop:\n"; +unset($c->y); +?> +==Done== +--EXPECTF-- + +--> Access non-visible static prop like instance prop: + +Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error2.phpt b/tests/classes/static_properties_003_error2.phpt new file mode 100644 index 0000000..589cc69 --- /dev/null +++ b/tests/classes/static_properties_003_error2.phpt @@ -0,0 +1,18 @@ +--TEST-- +Attempting to access static properties using instance property syntax +--FILE-- + Access non-visible static prop like instance prop:\n"; +echo $c->y; +?> +==Done== +--EXPECTF-- + +--> Access non-visible static prop like instance prop: + +Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error3.phpt b/tests/classes/static_properties_003_error3.phpt new file mode 100644 index 0000000..3e01e0e --- /dev/null +++ b/tests/classes/static_properties_003_error3.phpt @@ -0,0 +1,18 @@ +--TEST-- +Attempting to access static properties using instance property syntax +--FILE-- + Access non-visible static prop like instance prop:\n"; +$c->y = 1; +?> +==Done== +--EXPECTF-- + +--> Access non-visible static prop like instance prop: + +Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_003_error4.phpt b/tests/classes/static_properties_003_error4.phpt new file mode 100644 index 0000000..fd69a9f --- /dev/null +++ b/tests/classes/static_properties_003_error4.phpt @@ -0,0 +1,18 @@ +--TEST-- +Attempting to access static properties using instance property syntax +--FILE-- + Access non-visible static prop like instance prop:\n"; +$c->y =& $ref; +?> +==Done== +--EXPECTF-- + +--> Access non-visible static prop like instance prop: + +Fatal error: Cannot access protected property C::$y in %s on line 8 diff --git a/tests/classes/static_properties_004.phpt b/tests/classes/static_properties_004.phpt new file mode 100644 index 0000000..ce1d19d --- /dev/null +++ b/tests/classes/static_properties_004.phpt @@ -0,0 +1,37 @@ +--TEST-- +Inherited static properties can be separated from their reference set. +--FILE-- + +==Done== +--EXPECTF-- +Inherited static properties refer to the same value accross classes: +%unicode|string%(8) "original" +%unicode|string%(8) "original" +%unicode|string%(8) "original" + +Changing one changes all the others: +%unicode|string%(11) "changed.all" +%unicode|string%(11) "changed.all" +%unicode|string%(11) "changed.all" + +But because this is implemented using PHP references, the reference set can easily be split: +%unicode|string%(11) "changed.all" +%unicode|string%(11) "changed.one" +%unicode|string%(11) "changed.all" +==Done== \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_assign.phpt b/tests/classes/static_properties_undeclared_assign.phpt new file mode 100644 index 0000000..99340e9 --- /dev/null +++ b/tests/classes/static_properties_undeclared_assign.phpt @@ -0,0 +1,9 @@ +--TEST-- +Assigning to a non-existent static property +--FILE-- + +--EXPECTF-- +Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_assignInc.phpt b/tests/classes/static_properties_undeclared_assignInc.phpt new file mode 100644 index 0000000..258f2f8 --- /dev/null +++ b/tests/classes/static_properties_undeclared_assignInc.phpt @@ -0,0 +1,9 @@ +--TEST-- +Assigning & incrementing a non-existent static property +--FILE-- + +--EXPECTF-- +Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_assignRef.phpt b/tests/classes/static_properties_undeclared_assignRef.phpt new file mode 100644 index 0000000..75cf270 --- /dev/null +++ b/tests/classes/static_properties_undeclared_assignRef.phpt @@ -0,0 +1,10 @@ +--TEST-- +Assigning a non-existent static property by reference +--FILE-- + +--EXPECTF-- +Fatal error: Access to undeclared static property: C::$p in %s on line 4 \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_inc.phpt b/tests/classes/static_properties_undeclared_inc.phpt new file mode 100644 index 0000000..ff8b8c3 --- /dev/null +++ b/tests/classes/static_properties_undeclared_inc.phpt @@ -0,0 +1,9 @@ +--TEST-- +Incrementing a non-existent static property +--FILE-- + +--EXPECTF-- +Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_isset.phpt b/tests/classes/static_properties_undeclared_isset.phpt new file mode 100644 index 0000000..58aac40 --- /dev/null +++ b/tests/classes/static_properties_undeclared_isset.phpt @@ -0,0 +1,9 @@ +--TEST-- +Issetting a non-existent static property +--FILE-- + +--EXPECTF-- +bool(false) \ No newline at end of file diff --git a/tests/classes/static_properties_undeclared_read.phpt b/tests/classes/static_properties_undeclared_read.phpt new file mode 100644 index 0000000..715b41e --- /dev/null +++ b/tests/classes/static_properties_undeclared_read.phpt @@ -0,0 +1,9 @@ +--TEST-- +Reading a non-existent static property +--FILE-- + +--EXPECTF-- +Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt new file mode 100644 index 0000000..91b0287 --- /dev/null +++ b/tests/classes/static_this.phpt @@ -0,0 +1,39 @@ +--TEST-- +ZE2 $this can be an argument to a static function +--FILE-- +Test1(); + } + + static function Test1() + { + var_dump($this); + } + + static function Test2($this) + { + var_dump($this); + } +} + +$obj = new TestClass; +TestClass::Test2(new stdClass); + +?> +===DONE=== +--EXPECTF-- + +Notice: Undefined variable: this in %sstatic_this.php on line %d +NULL + +Notice: Undefined variable: this in %sstatic_this.php on line %d +NULL +object(stdClass)#%d (0) { +} +===DONE=== diff --git a/tests/classes/this.phpt b/tests/classes/this.phpt new file mode 100644 index 0000000..1d9c623 --- /dev/null +++ b/tests/classes/this.phpt @@ -0,0 +1,54 @@ +--TEST-- +ZE2 $this cannot be exchanged +--SKIPIF-- + +--FILE-- +prop; + print $other->prop; + } + + function indirect($other) + { + echo __METHOD__ . "\n"; + $this = $other; + $result = $this = $other; + print $result->prop; + print $this->prop; + } + + function retrieve(&$other) + { + echo __METHOD__ . "\n"; + $other = $this; + } +} + +$object = new Foo; +$object->prop = "Hello\n"; + +$other = new Foo; +$other->prop = "World\n"; + +$object->replace($other); +$object->indirect($other); + +print $object->prop; // still shows 'Hello' + +$object->retrieve($other); +print $other->prop; // shows 'Hello' + +?> +===DONE=== +--EXPECTF-- +Fatal error: Cannot re-assign $this in %sthis.php on line %d diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt new file mode 100644 index 0000000..53144ca --- /dev/null +++ b/tests/classes/tostring_001.phpt @@ -0,0 +1,130 @@ +--TEST-- +ZE2 __toString() +--FILE-- +__toString()] = "ERROR"; +echo $ar[$o]; + +echo "====test8====\n"; +var_dump(trim($o)); +var_dump(trim((string)$o)); + +echo "====test9====\n"; +echo sprintf("%s", $o); + +echo "====test10====\n"; +$o = new test3; +var_dump($o); +echo $o; + +?> +====DONE==== +--EXPECTF-- +====test1==== +test1 Object +( +) +string(54) "Object of class test1 could not be converted to string" +string(0) "" +object(test1)#%d (0) { +} +====test2==== +test2 Object +( +) +test2::__toString() +Converted +object(test2)#%d (0) { +} +====test3==== +test2::__toString() +Converted +====test4==== +test2::__toString() +string:Converted +====test5==== +test2::__toString() +1Converted +1test2::__toString() +Converted +====test6==== +test2::__toString() +test2::__toString() +Converted +Converted +test2::__toString() +Converted +test2::__toString() +Converted +====test7==== +test2::__toString() +string(19) "Illegal offset type" +====test8==== +test2::__toString() +string(9) "Converted" +test2::__toString() +string(9) "Converted" +====test9==== +test2::__toString() +Converted +====test10==== +object(test3)#%d (0) { +} +test3::__toString() +string(53) "Method test3::__toString() must return a string value" +====DONE==== diff --git a/tests/classes/tostring_002.phpt b/tests/classes/tostring_002.phpt new file mode 100644 index 0000000..8a4a7af --- /dev/null +++ b/tests/classes/tostring_002.phpt @@ -0,0 +1,31 @@ +--TEST-- +ZE2 __toString() in __destruct +--SKIPIF-- + +--FILE-- + +====DONE==== +--EXPECTF-- +Hello +====DONE==== +Hello diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt new file mode 100644 index 0000000..8815bd9 --- /dev/null +++ b/tests/classes/tostring_003.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 __toString() in __destruct/exception +--FILE-- +getMessage()); +} + +?> +====DONE==== +--EXPECTF-- +Fatal error: Method Test::__toString() must not throw an exception in %stostring_003.php on line %d diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt new file mode 100644 index 0000000..de0283e --- /dev/null +++ b/tests/classes/tostring_004.phpt @@ -0,0 +1,56 @@ +--TEST-- +Object to string conversion: error cases and behaviour variations. +--FILE-- + +--EXPECTF-- +Object with no __toString(): +Try 1: +Error: 4096 - Object of class stdClass could not be converted to string +Error: 8 - Object of class stdClass to string conversion +Object + +Try 2: +Error: 4096 - Object of class stdClass could not be converted to string + + + +Object with bad __toString(): +Try 1: +Error: 4096 - Method badToString::__toString() must return a string value + + +Try 2: +Error: 4096 - Method badToString::__toString() must return a string value + diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt new file mode 100644 index 0000000..f55dd53 --- /dev/null +++ b/tests/classes/type_hinting_001.phpt @@ -0,0 +1,38 @@ +--TEST-- +ZE2 class type hinting +--SKIPIF-- + +--FILE-- +a($b); +$a->b($b); + +?> +--EXPECTF-- + +Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s on line 12 diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt new file mode 100644 index 0000000..7c685bf --- /dev/null +++ b/tests/classes/type_hinting_002.phpt @@ -0,0 +1,16 @@ +--TEST-- +ZE2 class type hinting non existing class +--SKIPIF-- + +--FILE-- +a($o); +?> +--EXPECTF-- +Catchable fatal error: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s on line %d diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt new file mode 100644 index 0000000..a966210 --- /dev/null +++ b/tests/classes/type_hinting_003.phpt @@ -0,0 +1,60 @@ +--TEST-- +ZE2 class type hinting with arrays +--FILE-- + +--EXPECTF-- +Test::f1() +array(1) { + [0]=> + int(42) +} +Test::f2() +NULL +Test::f2() +NULL +Test::f3() +array(0) { +} +Test::f4() +array(1) { + [0]=> + int(25) +} + +Catchable fatal error: Argument 1 passed to Test::f1() must be of the type array, integer given, called in %s on line %d and defined in %s on line %d diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt new file mode 100644 index 0000000..9068909 --- /dev/null +++ b/tests/classes/type_hinting_004.phpt @@ -0,0 +1,109 @@ +--TEST-- +Ensure type hints are enforced for functions invoked as callbacks. +--FILE-- + Type hints with callback function:\n"; + class A { } + function f1(A $a) { + echo "in f1;\n"; + } + function f2(A $a = null) { + echo "in f2;\n"; + } + call_user_func('f1', 1); + call_user_func('f1', new A); + call_user_func('f2', 1); + call_user_func('f2'); + call_user_func('f2', new A); + call_user_func('f2', null); + + + echo "\n\n---> Type hints with callback static method:\n"; + class C { + static function f1(A $a) { + if (isset($this)) { + echo "in C::f1 (instance);\n"; + } else { + echo "in C::f1 (static);\n"; + } + } + static function f2(A $a = null) { + if (isset($this)) { + echo "in C::f2 (instance);\n"; + } else { + echo "in C::f2 (static);\n"; + } + } + } + call_user_func(array('C', 'f1'), 1); + call_user_func(array('C', 'f1'), new A); + call_user_func(array('C', 'f2'), 1); + call_user_func(array('C', 'f2')); + call_user_func(array('C', 'f2'), new A); + call_user_func(array('C', 'f2'), null); + + + echo "\n\n---> Type hints with callback instance method:\n"; + class D { + function f1(A $a) { + if (isset($this)) { + echo "in C::f1 (instance);\n"; + } else { + echo "in C::f1 (static);\n"; + } + } + function f2(A $a = null) { + if (isset($this)) { + echo "in C::f2 (instance);\n"; + } else { + echo "in C::f2 (static);\n"; + } + } + } + $d = new D; + call_user_func(array($d, 'f1'), 1); + call_user_func(array($d, 'f1'), new A); + call_user_func(array($d, 'f2'), 1); + call_user_func(array($d, 'f2')); + call_user_func(array($d, 'f2'), new A); + call_user_func(array($d, 'f2'), null); + +?> +--EXPECTF-- +---> Type hints with callback function: +4096: Argument 1 passed to f1() must be an instance of A, integer given%s(10) +in f1; +in f1; +4096: Argument 1 passed to f2() must be an instance of A, integer given%s(13) +in f2; +in f2; +in f2; +in f2; + + +---> Type hints with callback static method: +4096: Argument 1 passed to C::f1() must be an instance of A, integer given%s(26) +in C::f1 (static); +in C::f1 (static); +4096: Argument 1 passed to C::f2() must be an instance of A, integer given%s(33) +in C::f2 (static); +in C::f2 (static); +in C::f2 (static); +in C::f2 (static); + + +---> Type hints with callback instance method: +4096: Argument 1 passed to D::f1() must be an instance of A, integer given%s(51) +in C::f1 (instance); +in C::f1 (instance); +4096: Argument 1 passed to D::f2() must be an instance of A, integer given%s(58) +in C::f2 (instance); +in C::f2 (instance); +in C::f2 (instance); +in C::f2 (instance); diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt new file mode 100644 index 0000000..5e4c43b --- /dev/null +++ b/tests/classes/type_hinting_005a.phpt @@ -0,0 +1,18 @@ +--TEST-- +Check type hint compatibility in overrides with array hints. +--FILE-- + +==DONE== +--EXPECTF-- +Strict Standards: Declaration of D2::f() should be compatible with C::f(array $a) in %s on line 8 +Compatible hint. +Class hint, should be array. +==DONE== diff --git a/tests/classes/type_hinting_005b.phpt b/tests/classes/type_hinting_005b.phpt new file mode 100644 index 0000000..f13ab95 --- /dev/null +++ b/tests/classes/type_hinting_005b.phpt @@ -0,0 +1,14 @@ +--TEST-- +Check type hint compatibility in overrides with array hints. +--FILE-- + +==DONE== +--EXPECTF-- +Strict Standards: Declaration of D::f() should be compatible with C::f(array $a) in %s on line 5 +No hint, should be array. +==DONE== diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt new file mode 100644 index 0000000..30a114e --- /dev/null +++ b/tests/classes/type_hinting_005c.phpt @@ -0,0 +1,14 @@ +--TEST-- +Check type hint compatibility in overrides with array hints. +--FILE-- + +==DONE== +--EXPECTF-- +Strict Standards: Declaration of D::f() should be compatible with C::f(SomeClass $a) in %s on line 5 +Array hint, should be class. +==DONE== diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt new file mode 100644 index 0000000..830054d --- /dev/null +++ b/tests/classes/type_hinting_005d.phpt @@ -0,0 +1,14 @@ +--TEST-- +Check type hint compatibility in overrides with array hints. +--FILE-- + +==DONE== +--EXPECTF-- +Strict Standards: Declaration of D::f() should be compatible with C::f($a) in %s on line 5 +Array hint, should be nothing. +==DONE== diff --git a/tests/classes/unset_properties.phpt b/tests/classes/unset_properties.phpt new file mode 100644 index 0000000..264e720 --- /dev/null +++ b/tests/classes/unset_properties.phpt @@ -0,0 +1,154 @@ +--TEST-- +Un-setting instance properties causes magic methods to be called when trying to access them from outside the magic +methods themselves. +--FILE-- +$name = $value; + echo '__set "' . $name . '" to "' . $value . '"'; + } + + public function __isset($name) + { + echo '__isset "' . $name . '"'; + return isset($this->$name); + } + + public function getPublicProperty() + { + return $this->publicProperty; + } + + public function setPublicProperty($publicProperty) + { + $this->publicProperty = $publicProperty; + } + + public function unsetProtectedProperty() + { + unset($this->protectedProperty); + } + + public function getProtectedProperty() + { + return $this->protectedProperty; + } + + public function setProtectedProperty($protectedProperty) + { + $this->protectedProperty = $protectedProperty; + } + + public function unsetPrivateProperty() + { + unset($this->privateProperty); + } + + public function getPrivateProperty() + { + return $this->privateProperty; + } + + public function setPrivateProperty($privateProperty) + { + $this->privateProperty = $privateProperty; + } +} + +// verifying public property +$o = new Test; +echo $o->publicProperty; +echo "\n"; +var_export(isset($o->publicProperty)); +echo "\n"; +unset($o->publicProperty); +isset($o->publicProperty); +echo "\n"; +echo $o->publicProperty; +echo "\n"; +echo $o->getPublicProperty(); +echo "\n"; +echo $o->setPublicProperty('new publicProperty value via setter'); +echo "\n"; +echo $o->publicProperty; +echo "\n"; +unset($o->publicProperty); +$o->publicProperty = 'new publicProperty value via public access'; +echo "\n"; +var_export(isset($o->publicProperty)); +echo "\n"; +echo $o->publicProperty; +echo "\n\n"; + +// verifying protected property +echo $o->getProtectedProperty(); +echo "\n"; +$o->unsetProtectedProperty(); +var_export(isset($o->protectedProperty)); +echo "\n"; +echo $o->getProtectedProperty(); +echo "\n"; +echo $o->setProtectedProperty('new protectedProperty value via setter'); +echo "\n"; +var_export(isset($o->protectedProperty)); +echo "\n"; +echo $o->getProtectedProperty(); +echo "\n\n"; + +// verifying private property +echo $o->getPrivateProperty(); +echo "\n"; +$o->unsetPrivateProperty(); +var_export(isset($o->privateProperty)); +echo "\n"; +echo $o->getPrivateProperty(); +echo "\n"; +echo $o->setPrivateProperty('new privateProperty value via setter'); +echo "\n"; +var_export(isset($o->privateProperty)); +echo "\n"; +echo $o->getPrivateProperty(); +echo "\n\n"; + +?> + +--EXPECTF-- +publicProperty set +true +__isset "publicProperty" +__get "publicProperty" +__get "publicProperty" +__set "publicProperty" to "new publicProperty value via setter" +new publicProperty value via setter +__set "publicProperty" to "new publicProperty value via public access" +true +new publicProperty value via public access + +protectedProperty set +__isset "protectedProperty"false +__get "protectedProperty" +__set "protectedProperty" to "new protectedProperty value via setter" +__isset "protectedProperty"true +new protectedProperty value via setter + +privateProperty set +__isset "privateProperty"false +__get "privateProperty" +__set "privateProperty" to "new privateProperty value via setter" +__isset "privateProperty"true +new privateProperty value via setter diff --git a/tests/classes/visibility_000a.phpt b/tests/classes/visibility_000a.phpt new file mode 100644 index 0000000..2524494 --- /dev/null +++ b/tests/classes/visibility_000a.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000b.phpt b/tests/classes/visibility_000b.phpt new file mode 100644 index 0000000..9305467 --- /dev/null +++ b/tests/classes/visibility_000b.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_000c.phpt b/tests/classes/visibility_000c.phpt new file mode 100644 index 0000000..064106e --- /dev/null +++ b/tests/classes/visibility_000c.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_001a.phpt b/tests/classes/visibility_001a.phpt new file mode 100644 index 0000000..ebd1cc3 --- /dev/null +++ b/tests/classes/visibility_001a.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001b.phpt b/tests/classes/visibility_001b.phpt new file mode 100644 index 0000000..e61078e --- /dev/null +++ b/tests/classes/visibility_001b.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_001c.phpt b/tests/classes/visibility_001c.phpt new file mode 100644 index 0000000..bb1075a --- /dev/null +++ b/tests/classes/visibility_001c.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt new file mode 100644 index 0000000..6c88d20 --- /dev/null +++ b/tests/classes/visibility_002a.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002b.phpt b/tests/classes/visibility_002b.phpt new file mode 100644 index 0000000..71f47c3 --- /dev/null +++ b/tests/classes/visibility_002b.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d diff --git a/tests/classes/visibility_002c.phpt b/tests/classes/visibility_002c.phpt new file mode 100644 index 0000000..5edae1d --- /dev/null +++ b/tests/classes/visibility_002c.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_003a.phpt b/tests/classes/visibility_003a.phpt new file mode 100644 index 0000000..1693386 --- /dev/null +++ b/tests/classes/visibility_003a.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt new file mode 100644 index 0000000..fcfdbe3 --- /dev/null +++ b/tests/classes/visibility_003b.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line %d diff --git a/tests/classes/visibility_003c.phpt b/tests/classes/visibility_003c.phpt new file mode 100644 index 0000000..d94a9c1 --- /dev/null +++ b/tests/classes/visibility_003c.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_004a.phpt b/tests/classes/visibility_004a.phpt new file mode 100644 index 0000000..6f16a09 --- /dev/null +++ b/tests/classes/visibility_004a.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_004b.phpt b/tests/classes/visibility_004b.phpt new file mode 100644 index 0000000..74a8318 --- /dev/null +++ b/tests/classes/visibility_004b.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_004c.phpt b/tests/classes/visibility_004c.phpt new file mode 100644 index 0000000..92a7703 --- /dev/null +++ b/tests/classes/visibility_004c.phpt @@ -0,0 +1,33 @@ +--TEST-- +ZE2 A redeclared method must have the same or higher visibility +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Done diff --git a/tests/classes/visibility_005.phpt b/tests/classes/visibility_005.phpt new file mode 100644 index 0000000..859a5f7 --- /dev/null +++ b/tests/classes/visibility_005.phpt @@ -0,0 +1,59 @@ +--TEST-- +ZE2 foreach and property visibility +--FILE-- +$v) { + echo "$k=>$v\n"; + } + } +} + +class derived extends base +{ +} + +$o = new base; +$o->d = 4; +echo "===base::function===\n"; +$o->f(); +echo "===base,foreach===\n"; +foreach($o as $k=>$v) { + echo "$k=>$v\n"; +} + +$o = new derived; +$o->d = 4; +echo "===derived::function===\n"; +$o->f(); +echo "===derived,foreach===\n"; +foreach($o as $k=>$v) { + echo "$k=>$v\n"; +} + +?> +--EXPECT-- +===base::function=== +a=>1 +b=>2 +c=>3 +d=>4 +===base,foreach=== +a=>1 +d=>4 +===derived::function=== +a=>1 +b=>2 +c=>3 +d=>4 +===derived,foreach=== +a=>1 +d=>4 diff --git a/tests/func/001.phpt b/tests/func/001.phpt new file mode 100644 index 0000000..d080406 --- /dev/null +++ b/tests/func/001.phpt @@ -0,0 +1,6 @@ +--TEST-- +Strlen() function test +--FILE-- + +--EXPECT-- +6 diff --git a/tests/func/002.phpt b/tests/func/002.phpt new file mode 100644 index 0000000..cb35f92 --- /dev/null +++ b/tests/func/002.phpt @@ -0,0 +1,21 @@ +--TEST-- +Static variables in functions +--FILE-- +5) continue; + echo "$k\n"; + } +} + +andi (3,10); +--EXPECT-- +hey +blah +hey +blah +Counting from 7 to 14 +7 +8 +9 +10 +11 +12 +13 +14 +hey +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +factorial(5) = 120 +factorial(6) = 720 +factorial(7) = 5040 +factorial(8) = 40320 +factorial(9) = 362880 +factorial(10) = 3628800 +and now, from a function... +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +(it should break at 5...) +factorial(0) = 1 +factorial(1) = 1 +factorial(2) = 2 +factorial(3) = 6 +factorial(4) = 24 +------ +720 +840 +3 +4 +5 + diff --git a/tests/func/004.phpt b/tests/func/004.phpt new file mode 100644 index 0000000..1434297 --- /dev/null +++ b/tests/func/004.phpt @@ -0,0 +1,65 @@ +--TEST-- +General function test +--FILE-- + +--EXPECT-- + +Before function declaration... +After function declaration... +Calling function for the first time... +---- +In function, printing the string "This works!" 10 times +0) This works! +1) This works! +2) This works! +3) This works! +4) This works! +5) This works! +6) This works! +7) This works! +8) This works! +9) This works! +Done with function... +----- +Returned from function call... +Calling the function for the second time... +---- +In function, printing the string "This like, really works and stuff..." 3 times +0) This like, really works and stuff... +1) This like, really works and stuff... +2) This like, really works and stuff... +Done with function... +----- +Returned from function call... +This is some other function, to ensure more than just one function works fine... diff --git a/tests/func/005.phpt b/tests/func/005.phpt new file mode 100644 index 0000000..c4215fe --- /dev/null +++ b/tests/func/005.phpt @@ -0,0 +1,19 @@ +--TEST-- +Testing register_shutdown_function() +--FILE-- + +--EXPECT-- +foo() will be called on shutdown... +foo + diff --git a/tests/func/005a.phpt b/tests/func/005a.phpt new file mode 100644 index 0000000..3c2bcb1 --- /dev/null +++ b/tests/func/005a.phpt @@ -0,0 +1,32 @@ +--TEST-- +Testing register_shutdown_function() with timeout. (Bug: #21513) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Start +Shutdown diff --git a/tests/func/006.phpt b/tests/func/006.phpt new file mode 100644 index 0000000..077b6f8 --- /dev/null +++ b/tests/func/006.phpt @@ -0,0 +1,26 @@ +--TEST-- +Output buffering tests +--INI-- +output_buffering=0 +output_handler= +zlib.output_compression=0 +zlib.output_handler= +--FILE-- + +--EXPECT-- +string(2) "2B" +string(2) "1A" diff --git a/tests/func/007.phpt b/tests/func/007.phpt new file mode 100644 index 0000000..73aae2e --- /dev/null +++ b/tests/func/007.phpt @@ -0,0 +1,22 @@ +--TEST-- +INI functions test +--FILE-- + +--EXPECT-- +ini_set_works +ini_restore_works diff --git a/tests/func/008.phpt b/tests/func/008.phpt new file mode 100644 index 0000000..48098e1 --- /dev/null +++ b/tests/func/008.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test for buffering in core functions with implicit flush off +--INI-- +implicit_flush=0 +--FILE-- + +--EXPECT-- +'foo1' + +'foo2' diff --git a/tests/func/009.phpt b/tests/func/009.phpt new file mode 100644 index 0000000..05b40e8 --- /dev/null +++ b/tests/func/009.phpt @@ -0,0 +1,16 @@ +--TEST-- +Test for buffering in core functions with implicit flush on +--INI-- +implicit_flush=1 +--FILE-- + +--EXPECT-- +'foo1' + +'foo2' diff --git a/tests/func/010.phpt b/tests/func/010.phpt new file mode 100644 index 0000000..f970283 --- /dev/null +++ b/tests/func/010.phpt @@ -0,0 +1,77 @@ +--TEST-- +function with many parameters +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +Done diff --git a/tests/func/ini_alter.phpt b/tests/func/ini_alter.phpt new file mode 100644 index 0000000..111e826 --- /dev/null +++ b/tests/func/ini_alter.phpt @@ -0,0 +1,19 @@ +--TEST-- +ini_alter() check +--CREDITS-- +Sebastian SchÃŒrmann +sebs@php.net +Testfest 2009 Munich +--FILE-- + +--EXPECT-- +string(1) "1" +string(1) "0" + diff --git a/tests/lang/001.phpt b/tests/lang/001.phpt new file mode 100644 index 0000000..71df318 --- /dev/null +++ b/tests/lang/001.phpt @@ -0,0 +1,6 @@ +--TEST-- +Simple If condition test +--FILE-- +0) { echo "Yes"; } ?> +--EXPECT-- +Yes diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt new file mode 100644 index 0000000..ec14d01 --- /dev/null +++ b/tests/lang/002.phpt @@ -0,0 +1,12 @@ +--TEST-- +Simple While Loop Test +--FILE-- + +--EXPECT-- +123456789 diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt new file mode 100644 index 0000000..7049db9 --- /dev/null +++ b/tests/lang/003.phpt @@ -0,0 +1,19 @@ +--TEST-- +Simple Switch Test +--FILE-- + +--EXPECT-- +good diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt new file mode 100644 index 0000000..be8ebf4 --- /dev/null +++ b/tests/lang/004.phpt @@ -0,0 +1,13 @@ +--TEST-- +Simple If/Else Test +--FILE-- + +--EXPECT-- +good diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt new file mode 100644 index 0000000..404a7cb --- /dev/null +++ b/tests/lang/005.phpt @@ -0,0 +1,16 @@ +--TEST-- +Simple If/ElseIf/Else Test +--FILE-- + +--EXPECT-- +good diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt new file mode 100644 index 0000000..2a2db01 --- /dev/null +++ b/tests/lang/006.phpt @@ -0,0 +1,23 @@ +--TEST-- +Nested If/ElseIf/Else Test +--FILE-- + +--EXPECT-- +good diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt new file mode 100644 index 0000000..4576d4e --- /dev/null +++ b/tests/lang/007.phpt @@ -0,0 +1,27 @@ +--TEST-- +Function call with global and static variables +--FILE-- + +--EXPECT-- +1 5 2 2 10 5 2 5 3 2 10 5 3 5 4 2 diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt new file mode 100644 index 0000000..d335e6f --- /dev/null +++ b/tests/lang/008.phpt @@ -0,0 +1,18 @@ +--TEST-- +Testing recursive function +--FILE-- + +--EXPECT-- +1 2 3 4 5 6 7 8 9 diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt new file mode 100644 index 0000000..ea2aa92 --- /dev/null +++ b/tests/lang/009.phpt @@ -0,0 +1,11 @@ +--TEST-- +Testing function parameter passing +--FILE-- + +--EXPECT-- +3 diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt new file mode 100644 index 0000000..603abe3 --- /dev/null +++ b/tests/lang/010.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing function parameter passing with a return value +--FILE-- + +--EXPECT-- +2 diff --git a/tests/lang/011.phpt b/tests/lang/011.phpt new file mode 100644 index 0000000..771ef7c --- /dev/null +++ b/tests/lang/011.phpt @@ -0,0 +1,23 @@ +--TEST-- +Testing nested functions +--FILE-- + +--EXPECT-- +4 Hello 4 diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt new file mode 100644 index 0000000..117137a --- /dev/null +++ b/tests/lang/012.phpt @@ -0,0 +1,18 @@ +--TEST-- +Testing stack after early function return +--FILE-- + +--EXPECT-- +HelloHello diff --git a/tests/lang/013.phpt b/tests/lang/013.phpt new file mode 100644 index 0000000..be84cdc --- /dev/null +++ b/tests/lang/013.phpt @@ -0,0 +1,10 @@ +--TEST-- +Testing eval function +--FILE-- + +--EXPECT-- +Hello diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt new file mode 100644 index 0000000..f0033b2 --- /dev/null +++ b/tests/lang/014.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing eval function inside user-defined function +--FILE-- + +--EXPECT-- +Hello diff --git a/tests/lang/015.inc b/tests/lang/015.inc new file mode 100644 index 0000000..d436a7b --- /dev/null +++ b/tests/lang/015.inc @@ -0,0 +1,3 @@ + diff --git a/tests/lang/015.phpt b/tests/lang/015.phpt new file mode 100644 index 0000000..952e7f1 --- /dev/null +++ b/tests/lang/015.phpt @@ -0,0 +1,8 @@ +--TEST-- +Testing include +--FILE-- + +--EXPECT-- +Hello diff --git a/tests/lang/016.inc b/tests/lang/016.inc new file mode 100644 index 0000000..b73333f --- /dev/null +++ b/tests/lang/016.inc @@ -0,0 +1,5 @@ + diff --git a/tests/lang/016.phpt b/tests/lang/016.phpt new file mode 100644 index 0000000..dbaa908 --- /dev/null +++ b/tests/lang/016.phpt @@ -0,0 +1,9 @@ +--TEST-- +Testing user-defined function in included file +--FILE-- + +--EXPECT-- +Hello diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt new file mode 100644 index 0000000..fb90964 --- /dev/null +++ b/tests/lang/017.phpt @@ -0,0 +1,18 @@ +--TEST-- +Testing user-defined function falling out of an If into another +--FILE-- + +--EXPECT-- +1 diff --git a/tests/lang/018.phpt b/tests/lang/018.phpt new file mode 100644 index 0000000..638b131 --- /dev/null +++ b/tests/lang/018.phpt @@ -0,0 +1,34 @@ +--TEST-- +eval() test +--FILE-- + +--EXPECT-- +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 +In branch 1 +Inner default... +blah=100 diff --git a/tests/lang/021.phpt b/tests/lang/021.phpt new file mode 100644 index 0000000..aff45b6 --- /dev/null +++ b/tests/lang/021.phpt @@ -0,0 +1,42 @@ +--TEST-- +Switch test 2 +--FILE-- + +--EXPECT-- +i=0 +In branch 0 +i=1 +In branch 1 +i=2 +In branch 2 +i=3 +In branch 3 +hi diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt new file mode 100644 index 0000000..dddc6c2 --- /dev/null +++ b/tests/lang/022.phpt @@ -0,0 +1,63 @@ +--TEST-- +Switch test 3 +--FILE-- + +--EXPECT-- +zero +one +2 +3 +4 +5 +6 +7 +8 +9 +zero +one +2 +3 +4 +5 +6 +7 +8 +9 +zero +one +2 +3 +4 +5 +6 +7 +8 +9 diff --git a/tests/lang/023-1.inc b/tests/lang/023-1.inc new file mode 100644 index 0000000..8d52e84 --- /dev/null +++ b/tests/lang/023-1.inc @@ -0,0 +1,356 @@ + + + + +*** Testing assignments and variable aliasing: ***
+ +This should read "blah": \n"; ?> +This should read "this is nifty": \n"; ?> +*************************************************
+ +*** Testing integer operators ***
+ +Correct result - 8:
+Correct result - 8:
+Correct result - 2:
+Correct result - -2:
+Correct result - 15:
+Correct result - 15:
+Correct result - 2:
+Correct result - 3:
+*********************************
+ +*** Testing real operators ***
+ +Correct result - 8:
+Correct result - 8:
+Correct result - 2:
+Correct result - -2:
+Correct result - 15:
+Correct result - 15:
+Correct result - 2:
+Correct result - 3:
+*********************************
+ +*** Testing if/elseif/else control ***
+ +\n"; +} elseif ($a == "5") { + echo "This "." works
\n"; + $a = 6; + if ("andi" == ($test = "andi")) { + echo "this_still_works
\n"; + } elseif (1) { + echo "should_not_print
\n"; + } else { + echo "should_not_print
\n"; + } + if (44 == 43) { + echo "should_not_print
\n"; + } else { + echo "should_print
\n"; + } +} elseif ($a == 6) { + echo "this "."broken
\n"; + if (0) { + echo "this_should_not_print
\n"; + } else { + echo "TestingDanglingElse_This_Should_not_print
\n"; + } +} else { + echo "This "."does "." not"." work
\n"; +} +?> + + +*** Seriously nested if's test ***
+** spelling correction by kluzz ** +\n"; +if (0) { /* this code is not supposed to be executed */ + echo "hmm, this shouldn't be displayed #1
\n"; + $j++; + if (1) { + $i ++= + $j; + if (0) { + $j = ++$i; + if (1) { + $j *= $i; + echo "damn, this shouldn't be displayed
\n"; + } else { + $j /= $i; + ++$j; + echo "this shouldn't be displayed either
\n"; + } + } elseif (1) { + $i++; $j++; + echo "this isn't supposed to be displayed
\n"; + } + } elseif (0) { + $i++; + echo "this definitely shouldn't be displayed
\n"; + } else { + --$j; + echo "and this too shouldn't be displayed
\n"; + while ($j>0) { + $j--; + } + } +} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ + $i = ++$j; + echo "hmm, this shouldn't be displayed #2
\n"; + if (1) { + $j = ++$i; + if (0) { + $j = $i*2+$j*($i++); + if (1) { + $i++; + echo "damn, this shouldn't be displayed
\n"; + } else { + $j++; + echo "this shouldn't be displayed either
\n"; + } + } else if (1) { + ++$j; + echo "this isn't supposed to be displayed
\n"; + } + } elseif (0) { + $j++; + echo "this definitely shouldn't be displayed
\n"; + } else { + $i++; + echo "and this too shouldn't be displayed
\n"; + } +} else { + $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ + echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j
\n"; + if (1) { + $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ + if (0) { + $j += 40; + if (1) { + $i += 50; + echo "damn, this shouldn't be displayed
\n"; + } else { + $j += 20; + echo "this shouldn't be displayed either
\n"; + } + } else if (1) { + $j *= $i; /* $j *= 2 --> $j == 4 */ + echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j
\n"; + echo "3 loop iterations should follow:
\n"; + while ($i<=$j) { + echo $i++." $j
\n"; + } + } + } elseif (0) { + echo "this definitely shouldn't be displayed
\n"; + } else { + echo "and this too shouldn't be displayed
\n"; + } + echo "**********************************
\n"; +} +?> + +*** C-style else-if's ***
+\n"; + } else if ($a++) { + echo "This shouldn't be displayed either
\n"; + } else if (--$a) { + echo "No, this neither
\n"; + } else if (++$a) { + echo "This should be displayed
\n"; + } else { + echo "This shouldn't be displayed at all
\n"; + } +?> +*************************
+ +*** WHILE tests ***
+$j) { + echo "$i is greater than $j
\n"; + } else if ($i==$j) { + echo "$i equals $j
\n"; + } else { + echo "$i is smaller than $j
\n"; + } + $i++; +} +?> +*******************
+ + +*** Nested WHILEs ***
+\n"; + +$i=0; +while ($i<$arr_len) { + $j=0; + while ($j<$arr_len) { + $k=0; + while ($k<$arr_len) { + echo "\${test$i$j}[$k] = ".${"test$i$j"}[$k]."
\n"; + $k++; + } + $j++; + } + $i++; +} +?> +*********************
+ +*** hash test... ***
+\n"; +} +*/ +echo "commented out..."; +?> + +**************************
+ +*** Hash resizing test ***
+ 0) { + $a = $a . 'a'; + echo "$a
\n"; + $resize[$a] = $i; + $i--; +} +$i = 10; +$a = 'b'; +while ($i > 0) { + $a = $a . 'a'; + echo "$a
\n"; + echo $resize[$a]."
\n"; + $i--; +} +?> +**************************
+ + +*** break/continue test ***
+\n"; +while ($i<5) { + if ($i>2) { + break; + } + $j=0; + echo "\$j should go from 3 to 4, and \$q should go from 3 to 4
\n"; + while ($j<5) { + if ($j<=2) { + $j++; + continue; + } + echo " \$j=$j
\n"; + for ($q=0; $q<=10; $q++) { + if ($q<3) { + continue; + } + if ($q>4) { + break; + } + echo " \$q=$q
\n"; + } + $j++; + } + $j=0; + echo "\$j should go from 0 to 2
\n"; + while ($j<5) { + if ($j>2) { + $k=0; + echo "\$k should go from 0 to 2
\n"; + while ($k<5) { + if ($k>2) { + break 2; + } + echo " \$k=$k
\n"; + $k++; + } + } + echo " \$j=$j
\n"; + $j++; + } + echo "\$i=$i
\n"; + $i++; +} +?> +***********************
+ +*** Nested file include test ***
+ +********************************
+ +\n"; # testing some PHP style comment... +} +?> diff --git a/tests/lang/023-2.inc b/tests/lang/023-2.inc new file mode 100644 index 0000000..6dd1e73 --- /dev/null +++ b/tests/lang/023-2.inc @@ -0,0 +1,6 @@ + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. + + + diff --git a/tests/lang/023.phpt b/tests/lang/023.phpt new file mode 100644 index 0000000..331308d --- /dev/null +++ b/tests/lang/023.phpt @@ -0,0 +1,256 @@ +--TEST-- +Regression test +--INI-- +date.timezone=UTC +--FILE-- +PHP Regression Test + +0) { + $days = $time_left/(24*3600); + $time_left -= $days*24*3600; + $hours = $time_left/3600; + $time_left -= $hours*3600; + $minutes = $time_left/60; + echo "Limor Ullmann is getting married on ".($wedding_date=date("l, F dS, Y",$wedding_timestamp)).",\nwhich is $days days, $hours hours and $minutes minutes from now.\n"; + echo "Her hashed wedding date is $wedding_date.\n"; +} else { + echo "Limor Ullmann is now Limor Baruch :I\n"; +} +?> +--EXPECT-- +PHP Regression Test + + + + +*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+ +*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+ +*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+ +*** Testing if/elseif/else control ***
+ +This works
+this_still_works
+should_print
+ + +*** Seriously nested if's test ***
+** spelling correction by kluzz ** +Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+ +*** C-style else-if's ***
+This should be displayed
+*************************
+ +*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+ + +*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+ +*** hash test... ***
+commented out... +**************************
+ +*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+ + +*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+ +*** Nested file include test ***
+ +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +********************************
+ +Tests completed.
+Limor Ullmann is now Limor Baruch :I diff --git a/tests/lang/024.phpt b/tests/lang/024.phpt new file mode 100644 index 0000000..954b58f --- /dev/null +++ b/tests/lang/024.phpt @@ -0,0 +1,11623 @@ +--TEST-- +Looped regression test (may take a while) +--FILE-- + + + +*** Testing assignments and variable aliasing: *** + +This should read "blah": +This should read "this is nifty": +************************************************* + +*** Testing integer operators *** + +Correct result - 8: + +Correct result - 8: + +Correct result - 2: + +Correct result - -2: + +Correct result - 15: + +Correct result - 15: + +Correct result - 2: + +Correct result - 3: + +********************************* + +*** Testing real operators *** + +Correct result - 8: + +Correct result - 8: + +Correct result - 2: + +Correct result - -2: + +Correct result - 15: + +Correct result - 15: + +Correct result - 2: + +Correct result - 3: + +********************************* + +*** Testing if/elseif/else control *** + + + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +0) { + $j--; + } + } +} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */ + $i = ++$j; + echo "hmm, this shouldn't be displayed #2\n"; + if (1) { + $j = ++$i; + if (0) { + $j = $i*2+$j*($i++); + if (1) { + $i++; + echo "damn, this shouldn't be displayed\n"; + } else { + $j++; + echo "this shouldn't be displayed either\n"; + } + } else if (1) { + ++$j; + echo "this isn't supposed to be displayed\n"; + } + } elseif (0) { + $j++; + echo "this definitely shouldn't be displayed\n"; + } else { + $i++; + echo "and this too shouldn't be displayed\n"; + } +} else { + $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */ + echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n"; + if (1) { + $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */ + if (0) { + $j += 40; + if (1) { + $i += 50; + echo "damn, this shouldn't be displayed\n"; + } else { + $j += 20; + echo "this shouldn't be displayed either\n"; + } + } else if (1) { + $j *= $i; /* $j *= 2 --> $j == 4 */ + echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n"; + echo "3 loop iterations should follow:\n"; + while ($i<=$j) { + echo $i++." $j\n"; + } + } + } elseif (0) { + echo "this definitely shouldn't be displayed\n"; + } else { + echo "and this too shouldn't be displayed\n"; + } + echo "**********************************\n"; +} +?> + +*** C-style else-if's *** + +************************* + +*** WHILE tests *** +$j) { + echo "$i is greater than $j\n"; + } else if ($i==$j) { + echo "$i equals $j\n"; + } else { + echo "$i is smaller than $j\n"; + } + $i++; +} +?> +******************* + + +*** Nested WHILEs *** + +********************* + +*** hash test... *** + + +************************** + +*** Hash resizing test *** + 0) { + $a = $a . "a"; + echo "$a\n"; + $resize[$a] = $i; + $i--; +} +$i = 10; +$a = "b"; +while ($i > 0) { + $a = $a . "a"; + echo "$a\n"; + echo $resize[$a]."\n"; + $i--; +} +?> +************************** + + +*** break/continue test *** +2) { + break; + } + $j=0; + echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n"; + while ($j<5) { + if ($j<=2) { + $j++; + continue; + } + echo " \$j=$j\n"; + for ($q=0; $q<=10; $q++) { + if ($q<3) { + continue; + } + if ($q>4) { + break; + } + echo " \$q=$q\n"; + } + $j++; + } + $j=0; + echo "\$j should go from 0 to 2\n"; + while ($j<5) { + if ($j>2) { + $k=0; + echo "\$k should go from 0 to 2\n"; + while ($k<5) { + if ($k>2) { + break 2; + } + echo " \$k=$k\n"; + $k++; + } + } + echo " \$j=$j\n"; + $j++; + } + echo "\$i=$i\n"; + $i++; +} +?> +*********************** + +*** Nested file include test *** + +******************************** + + +--EXPECT-- + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. + + +*** Testing assignments and variable aliasing: *** +This should read "blah": blah +This should read "this is nifty": this is nifty +************************************************* + +*** Testing integer operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing real operators *** +Correct result - 8: 8 +Correct result - 8: 8 +Correct result - 2: 2 +Correct result - -2: -2 +Correct result - 15: 15 +Correct result - 15: 15 +Correct result - 2: 2 +Correct result - 3: 3 +********************************* + +*** Testing if/elseif/else control *** + +This works +this_still_works +should_print + + +*** Seriously nested if's test *** +** spelling correction by kluzz ** +Only two lines of text should follow: +this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0 +this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4 +3 loop iterations should follow: +2 4 +3 4 +4 4 +********************************** + +*** C-style else-if's *** +This should be displayed +************************* + +*** WHILE tests *** +0 is smaller than 20 +1 is smaller than 20 +2 is smaller than 20 +3 is smaller than 20 +4 is smaller than 20 +5 is smaller than 20 +6 is smaller than 20 +7 is smaller than 20 +8 is smaller than 20 +9 is smaller than 20 +10 is smaller than 20 +11 is smaller than 20 +12 is smaller than 20 +13 is smaller than 20 +14 is smaller than 20 +15 is smaller than 20 +16 is smaller than 20 +17 is smaller than 20 +18 is smaller than 20 +19 is smaller than 20 +20 equals 20 +21 is greater than 20 +22 is greater than 20 +23 is greater than 20 +24 is greater than 20 +25 is greater than 20 +26 is greater than 20 +27 is greater than 20 +28 is greater than 20 +29 is greater than 20 +30 is greater than 20 +31 is greater than 20 +32 is greater than 20 +33 is greater than 20 +34 is greater than 20 +35 is greater than 20 +36 is greater than 20 +37 is greater than 20 +38 is greater than 20 +39 is greater than 20 +******************* + + +*** Nested WHILEs *** +Each array variable should be equal to the sum of its indices: +${test00}[0] = 0 +${test00}[1] = 1 +${test00}[2] = 2 +${test01}[0] = 1 +${test01}[1] = 2 +${test01}[2] = 3 +${test02}[0] = 2 +${test02}[1] = 3 +${test02}[2] = 4 +${test10}[0] = 1 +${test10}[1] = 2 +${test10}[2] = 3 +${test11}[0] = 2 +${test11}[1] = 3 +${test11}[2] = 4 +${test12}[0] = 3 +${test12}[1] = 4 +${test12}[2] = 5 +${test20}[0] = 2 +${test20}[1] = 3 +${test20}[2] = 4 +${test21}[0] = 3 +${test21}[1] = 4 +${test21}[2] = 5 +${test22}[0] = 4 +${test22}[1] = 5 +${test22}[2] = 6 +********************* + +*** hash test... *** +commented out... +************************** + +*** Hash resizing test *** +ba +baa +baaa +baaaa +baaaaa +baaaaaa +baaaaaaa +baaaaaaaa +baaaaaaaaa +baaaaaaaaaa +ba +10 +baa +9 +baaa +8 +baaaa +7 +baaaaa +6 +baaaaaa +5 +baaaaaaa +4 +baaaaaaaa +3 +baaaaaaaaa +2 +baaaaaaaaaa +1 +************************** + + +*** break/continue test *** +$i should go from 0 to 2 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=0 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=1 +$j should go from 3 to 4, and $q should go from 3 to 4 + $j=3 + $q=3 + $q=4 + $j=4 + $q=3 + $q=4 +$j should go from 0 to 2 + $j=0 + $j=1 + $j=2 +$k should go from 0 to 2 + $k=0 + $k=1 + $k=2 +$i=2 +*********************** + +*** Nested file include test *** + +This is Finish.phtml. This file is supposed to be included +from regression_test.phtml. This is normal HTML. +and this is PHP code, 2+2=4 + +******************************** + +Tests completed. diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt new file mode 100644 index 0000000..382960f --- /dev/null +++ b/tests/lang/025.phpt @@ -0,0 +1,531 @@ +--TEST-- +Mean recursion test +--FILE-- + +--EXPECT-- + 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 4 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 4 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 2 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 4 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 4 a 4 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 5 a 5 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 6 a 6 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 7 a 7 a 8 a 9 + b 10 + b 9 a 9 + b 10 + b 8 a 8 a 9 + b 10 + b 9 a 9 + b 10 diff --git a/tests/lang/026.phpt b/tests/lang/026.phpt new file mode 100644 index 0000000..eb2d621 --- /dev/null +++ b/tests/lang/026.phpt @@ -0,0 +1,6 @@ +--TEST-- +Testing string scanner confirmance +--FILE-- + +--EXPECT-- +" \'\n\'a\\b\ diff --git a/tests/lang/027.phpt b/tests/lang/027.phpt new file mode 100644 index 0000000..d3eb74b --- /dev/null +++ b/tests/lang/027.phpt @@ -0,0 +1,12 @@ +--TEST-- +Testing do-while loop +--FILE-- +0); +?> +--EXPECT-- +321 diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt new file mode 100644 index 0000000..bd4525e --- /dev/null +++ b/tests/lang/028.phpt @@ -0,0 +1,1058 @@ +--TEST-- +Testing calling user-level functions from C +--FILE-- +myname = "Dafna"; + } + function GetMyName() { + return $this->myname; + } + function SetMyName($name) { + $this->myname = $name; + } +}; + +for ($i=0; $i<200; $i++): + print "$i\n"; + call_user_func("dafna"); + call_user_func("print_stuff","Hey there!!\n"); + print "$i\n"; +endfor; + + +$dafna = new dafna_class(); + +print $name=call_user_func(array(&$dafna,"GetMyName")); +print "\n"; + +?> +--EXPECT-- +0 +Dafna! +I'm still alive +Hey there!! +0 +1 +Dafna! +I'm still alive +Hey there!! +1 +2 +Dafna! +I'm still alive +Hey there!! +2 +3 +Dafna! +I'm still alive +Hey there!! +3 +4 +Dafna! +I'm still alive +Hey there!! +4 +5 +Dafna! +I'm still alive +Hey there!! +5 +6 +Dafna! +I'm still alive +Hey there!! +6 +7 +Dafna! +I'm still alive +Hey there!! +7 +8 +Dafna! +I'm still alive +Hey there!! +8 +9 +Dafna! +I'm still alive +Hey there!! +9 +10 +Dafna! +I'm still alive +Hey there!! +10 +11 +Dafna! +I'm still alive +Hey there!! +11 +12 +Dafna! +I'm still alive +Hey there!! +12 +13 +Dafna! +I'm still alive +Hey there!! +13 +14 +Dafna! +I'm still alive +Hey there!! +14 +15 +Dafna! +I'm still alive +Hey there!! +15 +16 +Dafna! +I'm still alive +Hey there!! +16 +17 +Dafna! +I'm still alive +Hey there!! +17 +18 +Dafna! +I'm still alive +Hey there!! +18 +19 +Dafna! +I'm still alive +Hey there!! +19 +20 +Dafna! +I'm still alive +Hey there!! +20 +21 +Dafna! +I'm still alive +Hey there!! +21 +22 +Dafna! +I'm still alive +Hey there!! +22 +23 +Dafna! +I'm still alive +Hey there!! +23 +24 +Dafna! +I'm still alive +Hey there!! +24 +25 +Dafna! +I'm still alive +Hey there!! +25 +26 +Dafna! +I'm still alive +Hey there!! +26 +27 +Dafna! +I'm still alive +Hey there!! +27 +28 +Dafna! +I'm still alive +Hey there!! +28 +29 +Dafna! +I'm still alive +Hey there!! +29 +30 +Dafna! +I'm still alive +Hey there!! +30 +31 +Dafna! +I'm still alive +Hey there!! +31 +32 +Dafna! +I'm still alive +Hey there!! +32 +33 +Dafna! +I'm still alive +Hey there!! +33 +34 +Dafna! +I'm still alive +Hey there!! +34 +35 +Dafna! +I'm still alive +Hey there!! +35 +36 +Dafna! +I'm still alive +Hey there!! +36 +37 +Dafna! +I'm still alive +Hey there!! +37 +38 +Dafna! +I'm still alive +Hey there!! +38 +39 +Dafna! +I'm still alive +Hey there!! +39 +40 +Dafna! +I'm still alive +Hey there!! +40 +41 +Dafna! +I'm still alive +Hey there!! +41 +42 +Dafna! +I'm still alive +Hey there!! +42 +43 +Dafna! +I'm still alive +Hey there!! +43 +44 +Dafna! +I'm still alive +Hey there!! +44 +45 +Dafna! +I'm still alive +Hey there!! +45 +46 +Dafna! +I'm still alive +Hey there!! +46 +47 +Dafna! +I'm still alive +Hey there!! +47 +48 +Dafna! +I'm still alive +Hey there!! +48 +49 +Dafna! +I'm still alive +Hey there!! +49 +50 +Dafna! +I'm still alive +Hey there!! +50 +51 +Dafna! +I'm still alive +Hey there!! +51 +52 +Dafna! +I'm still alive +Hey there!! +52 +53 +Dafna! +I'm still alive +Hey there!! +53 +54 +Dafna! +I'm still alive +Hey there!! +54 +55 +Dafna! +I'm still alive +Hey there!! +55 +56 +Dafna! +I'm still alive +Hey there!! +56 +57 +Dafna! +I'm still alive +Hey there!! +57 +58 +Dafna! +I'm still alive +Hey there!! +58 +59 +Dafna! +I'm still alive +Hey there!! +59 +60 +Dafna! +I'm still alive +Hey there!! +60 +61 +Dafna! +I'm still alive +Hey there!! +61 +62 +Dafna! +I'm still alive +Hey there!! +62 +63 +Dafna! +I'm still alive +Hey there!! +63 +64 +Dafna! +I'm still alive +Hey there!! +64 +65 +Dafna! +I'm still alive +Hey there!! +65 +66 +Dafna! +I'm still alive +Hey there!! +66 +67 +Dafna! +I'm still alive +Hey there!! +67 +68 +Dafna! +I'm still alive +Hey there!! +68 +69 +Dafna! +I'm still alive +Hey there!! +69 +70 +Dafna! +I'm still alive +Hey there!! +70 +71 +Dafna! +I'm still alive +Hey there!! +71 +72 +Dafna! +I'm still alive +Hey there!! +72 +73 +Dafna! +I'm still alive +Hey there!! +73 +74 +Dafna! +I'm still alive +Hey there!! +74 +75 +Dafna! +I'm still alive +Hey there!! +75 +76 +Dafna! +I'm still alive +Hey there!! +76 +77 +Dafna! +I'm still alive +Hey there!! +77 +78 +Dafna! +I'm still alive +Hey there!! +78 +79 +Dafna! +I'm still alive +Hey there!! +79 +80 +Dafna! +I'm still alive +Hey there!! +80 +81 +Dafna! +I'm still alive +Hey there!! +81 +82 +Dafna! +I'm still alive +Hey there!! +82 +83 +Dafna! +I'm still alive +Hey there!! +83 +84 +Dafna! +I'm still alive +Hey there!! +84 +85 +Dafna! +I'm still alive +Hey there!! +85 +86 +Dafna! +I'm still alive +Hey there!! +86 +87 +Dafna! +I'm still alive +Hey there!! +87 +88 +Dafna! +I'm still alive +Hey there!! +88 +89 +Dafna! +I'm still alive +Hey there!! +89 +90 +Dafna! +I'm still alive +Hey there!! +90 +91 +Dafna! +I'm still alive +Hey there!! +91 +92 +Dafna! +I'm still alive +Hey there!! +92 +93 +Dafna! +I'm still alive +Hey there!! +93 +94 +Dafna! +I'm still alive +Hey there!! +94 +95 +Dafna! +I'm still alive +Hey there!! +95 +96 +Dafna! +I'm still alive +Hey there!! +96 +97 +Dafna! +I'm still alive +Hey there!! +97 +98 +Dafna! +I'm still alive +Hey there!! +98 +99 +Dafna! +I'm still alive +Hey there!! +99 +100 +Dafna! +I'm still alive +Hey there!! +100 +101 +Dafna! +I'm still alive +Hey there!! +101 +102 +Dafna! +I'm still alive +Hey there!! +102 +103 +Dafna! +I'm still alive +Hey there!! +103 +104 +Dafna! +I'm still alive +Hey there!! +104 +105 +Dafna! +I'm still alive +Hey there!! +105 +106 +Dafna! +I'm still alive +Hey there!! +106 +107 +Dafna! +I'm still alive +Hey there!! +107 +108 +Dafna! +I'm still alive +Hey there!! +108 +109 +Dafna! +I'm still alive +Hey there!! +109 +110 +Dafna! +I'm still alive +Hey there!! +110 +111 +Dafna! +I'm still alive +Hey there!! +111 +112 +Dafna! +I'm still alive +Hey there!! +112 +113 +Dafna! +I'm still alive +Hey there!! +113 +114 +Dafna! +I'm still alive +Hey there!! +114 +115 +Dafna! +I'm still alive +Hey there!! +115 +116 +Dafna! +I'm still alive +Hey there!! +116 +117 +Dafna! +I'm still alive +Hey there!! +117 +118 +Dafna! +I'm still alive +Hey there!! +118 +119 +Dafna! +I'm still alive +Hey there!! +119 +120 +Dafna! +I'm still alive +Hey there!! +120 +121 +Dafna! +I'm still alive +Hey there!! +121 +122 +Dafna! +I'm still alive +Hey there!! +122 +123 +Dafna! +I'm still alive +Hey there!! +123 +124 +Dafna! +I'm still alive +Hey there!! +124 +125 +Dafna! +I'm still alive +Hey there!! +125 +126 +Dafna! +I'm still alive +Hey there!! +126 +127 +Dafna! +I'm still alive +Hey there!! +127 +128 +Dafna! +I'm still alive +Hey there!! +128 +129 +Dafna! +I'm still alive +Hey there!! +129 +130 +Dafna! +I'm still alive +Hey there!! +130 +131 +Dafna! +I'm still alive +Hey there!! +131 +132 +Dafna! +I'm still alive +Hey there!! +132 +133 +Dafna! +I'm still alive +Hey there!! +133 +134 +Dafna! +I'm still alive +Hey there!! +134 +135 +Dafna! +I'm still alive +Hey there!! +135 +136 +Dafna! +I'm still alive +Hey there!! +136 +137 +Dafna! +I'm still alive +Hey there!! +137 +138 +Dafna! +I'm still alive +Hey there!! +138 +139 +Dafna! +I'm still alive +Hey there!! +139 +140 +Dafna! +I'm still alive +Hey there!! +140 +141 +Dafna! +I'm still alive +Hey there!! +141 +142 +Dafna! +I'm still alive +Hey there!! +142 +143 +Dafna! +I'm still alive +Hey there!! +143 +144 +Dafna! +I'm still alive +Hey there!! +144 +145 +Dafna! +I'm still alive +Hey there!! +145 +146 +Dafna! +I'm still alive +Hey there!! +146 +147 +Dafna! +I'm still alive +Hey there!! +147 +148 +Dafna! +I'm still alive +Hey there!! +148 +149 +Dafna! +I'm still alive +Hey there!! +149 +150 +Dafna! +I'm still alive +Hey there!! +150 +151 +Dafna! +I'm still alive +Hey there!! +151 +152 +Dafna! +I'm still alive +Hey there!! +152 +153 +Dafna! +I'm still alive +Hey there!! +153 +154 +Dafna! +I'm still alive +Hey there!! +154 +155 +Dafna! +I'm still alive +Hey there!! +155 +156 +Dafna! +I'm still alive +Hey there!! +156 +157 +Dafna! +I'm still alive +Hey there!! +157 +158 +Dafna! +I'm still alive +Hey there!! +158 +159 +Dafna! +I'm still alive +Hey there!! +159 +160 +Dafna! +I'm still alive +Hey there!! +160 +161 +Dafna! +I'm still alive +Hey there!! +161 +162 +Dafna! +I'm still alive +Hey there!! +162 +163 +Dafna! +I'm still alive +Hey there!! +163 +164 +Dafna! +I'm still alive +Hey there!! +164 +165 +Dafna! +I'm still alive +Hey there!! +165 +166 +Dafna! +I'm still alive +Hey there!! +166 +167 +Dafna! +I'm still alive +Hey there!! +167 +168 +Dafna! +I'm still alive +Hey there!! +168 +169 +Dafna! +I'm still alive +Hey there!! +169 +170 +Dafna! +I'm still alive +Hey there!! +170 +171 +Dafna! +I'm still alive +Hey there!! +171 +172 +Dafna! +I'm still alive +Hey there!! +172 +173 +Dafna! +I'm still alive +Hey there!! +173 +174 +Dafna! +I'm still alive +Hey there!! +174 +175 +Dafna! +I'm still alive +Hey there!! +175 +176 +Dafna! +I'm still alive +Hey there!! +176 +177 +Dafna! +I'm still alive +Hey there!! +177 +178 +Dafna! +I'm still alive +Hey there!! +178 +179 +Dafna! +I'm still alive +Hey there!! +179 +180 +Dafna! +I'm still alive +Hey there!! +180 +181 +Dafna! +I'm still alive +Hey there!! +181 +182 +Dafna! +I'm still alive +Hey there!! +182 +183 +Dafna! +I'm still alive +Hey there!! +183 +184 +Dafna! +I'm still alive +Hey there!! +184 +185 +Dafna! +I'm still alive +Hey there!! +185 +186 +Dafna! +I'm still alive +Hey there!! +186 +187 +Dafna! +I'm still alive +Hey there!! +187 +188 +Dafna! +I'm still alive +Hey there!! +188 +189 +Dafna! +I'm still alive +Hey there!! +189 +190 +Dafna! +I'm still alive +Hey there!! +190 +191 +Dafna! +I'm still alive +Hey there!! +191 +192 +Dafna! +I'm still alive +Hey there!! +192 +193 +Dafna! +I'm still alive +Hey there!! +193 +194 +Dafna! +I'm still alive +Hey there!! +194 +195 +Dafna! +I'm still alive +Hey there!! +195 +196 +Dafna! +I'm still alive +Hey there!! +196 +197 +Dafna! +I'm still alive +Hey there!! +197 +198 +Dafna! +I'm still alive +Hey there!! +198 +199 +Dafna! +I'm still alive +Hey there!! +199 +Dafna + diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt new file mode 100644 index 0000000..758369b --- /dev/null +++ b/tests/lang/030.phpt @@ -0,0 +1,36 @@ +--TEST-- +$this in constructor test +--FILE-- +Name = $name; + $GLOBALS['List']->echoName(); + } + + function echoName() { + $GLOBALS['names'][]=$this->Name; + } +} + +function &foo2(&$foo) { + return $foo; +} + + +$bar1 =new foo('constructor'); +$bar1->Name = 'outside'; +$bar1->echoName(); +$List->echoName(); + +$bar1 =& foo2(new foo('constructor')); +$bar1->Name = 'outside'; +$bar1->echoName(); + +$List->echoName(); + +print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure'; +?> +--EXPECT-- +success diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt new file mode 100644 index 0000000..b2d1e63 --- /dev/null +++ b/tests/lang/031.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug #16227 (Internal hash position bug on assignment) +--FILE-- + +--EXPECT-- +Correct - with inner loop reset. +inloop 0 for key1 +inloop 1 for key1 +inloop 0 for key2 +inloop 1 for key2 +What happens without inner loop reset. +inloop 0 for key1 +inloop 1 for key1 +What happens without inner loop reset but copy. +inloop 0 for key1 +inloop 1 for key1 +inloop 0 for key2 +inloop 1 for key2 +What happens with inner loop reset over copy. +inloop 0 for key1 +inloop 1 for key1 +inloop 0 for key2 +inloop 1 for key2 diff --git a/tests/lang/032.phpt b/tests/lang/032.phpt new file mode 100644 index 0000000..caa4c7e --- /dev/null +++ b/tests/lang/032.phpt @@ -0,0 +1,36 @@ +--TEST-- +Class method registration +--FILE-- + +--EXPECT-- +OK + diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt new file mode 100644 index 0000000..21e3768 --- /dev/null +++ b/tests/lang/033.phpt @@ -0,0 +1,47 @@ +--TEST-- +Alternative syntaxes test +--FILE-- + + +===DONE=== +--EXPECT-- +If: 11 +While: 12346789 +For: 0123401234 +Switch: 1 +===DONE=== diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt new file mode 100644 index 0000000..cea0797 --- /dev/null +++ b/tests/lang/034.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #12647 (Locale settings affecting float parsing) +--INI-- +precision=14 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +3,14 diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt new file mode 100644 index 0000000..9472999 --- /dev/null +++ b/tests/lang/035.phpt @@ -0,0 +1,38 @@ +--TEST-- +ZE2: set_exception_handler() +--SKIPIF-- + +--FILE-- +error = $_error; + } + + function getException() + { + return $this->error; + } +} + +function ThrowException() +{ + throw new MyException("'This is an exception!'"); +} + + +try { +} catch (MyException $exception) { + print "There shouldn't be an exception: " . $exception->getException(); + print "\n"; +} + +try { + ThrowException(); +} catch (MyException $exception) { + print "There was an exception: " . $exception->getException(); + print "\n"; +} +?> +--EXPECT-- +There was an exception: 'This is an exception!' diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt new file mode 100644 index 0000000..474316e --- /dev/null +++ b/tests/lang/036.phpt @@ -0,0 +1,27 @@ +--TEST-- +Child public element should not override parent private element in parent methods +--FILE-- +id; + } +}; + +class chld extends par { + public $id = "bar"; + function displayHim() + { + parent::displayMe(); + } +}; + + +$obj = new chld(); +$obj->displayHim(); +?> +--EXPECT-- +foo diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt new file mode 100644 index 0000000..c2a1ee3 --- /dev/null +++ b/tests/lang/037.phpt @@ -0,0 +1,30 @@ +--TEST-- +'Static' binding for private variables +--FILE-- +displayChild(); + } +}; + +class chld extends par { + private $id = "bar"; + + function displayChild() + { + print $this->id; + } +}; + + +$obj = new chld(); +$obj->displayMe(); + +?> +--EXPECT-- +bar diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt new file mode 100644 index 0000000..195050b --- /dev/null +++ b/tests/lang/038.phpt @@ -0,0 +1,41 @@ +--TEST-- +Convert warnings to exceptions +--FILE-- +file = $errfile; + $this->line = $errline; + } +} + +function Error2Exception($errno, $errstr, $errfile, $errline) +{ + throw new MyException($errstr, $errno);//, $errfile, $errline); +} + +$err_msg = 'no exception'; +set_error_handler('Error2Exception'); + +try +{ + $con = fopen("/tmp/a_file_that_does_not_exist",'r'); +} +catch (Exception $e) +{ + $trace = $e->getTrace(); + var_dump($trace[0]['function']); + var_dump($trace[1]['function']); +} + +?> +===DONE=== + +--EXPECTF-- +string(15) "Error2Exception" +string(5) "fopen" +===DONE=== diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt new file mode 100644 index 0000000..aa4b591 --- /dev/null +++ b/tests/lang/039.phpt @@ -0,0 +1,45 @@ +--TEST-- +Catch Interfaces +--FILE-- +file = $errfile; + $this->line = $errline; + } +} + +function Error2Exception($errno, $errstr, $errfile, $errline) +{ + throw new MyException($errstr, $errno, $errfile, $errline); +} + +$err_msg = 'no exception'; +set_error_handler('Error2Exception'); + +try +{ + $con = fopen('/tmp/a_file_that_does_not_exist','r'); +} +catch (Catchable $e) +{ + echo "Catchable\n"; +} +catch (Exception $e) +{ + echo "Exception\n"; +} + +?> +===DONE=== +--EXPECTF-- +Catchable +===DONE=== diff --git a/tests/lang/040.phpt b/tests/lang/040.phpt new file mode 100644 index 0000000..6d8ece9 --- /dev/null +++ b/tests/lang/040.phpt @@ -0,0 +1,15 @@ +--TEST-- +foreach into array +--FILE-- + +===DONE=== +--EXPECT-- +0 +1 +===DONE=== diff --git a/tests/lang/041.phpt b/tests/lang/041.phpt new file mode 100644 index 0000000..6972412 --- /dev/null +++ b/tests/lang/041.phpt @@ -0,0 +1,20 @@ +--TEST-- +Dynamic access of static members +--FILE-- + +===DONE=== +--EXPECTF-- +foo + +Fatal error: Class 'B' not found in %s041.php on line %d diff --git a/tests/lang/042.phpt b/tests/lang/042.phpt new file mode 100644 index 0000000..217aab8 --- /dev/null +++ b/tests/lang/042.phpt @@ -0,0 +1,19 @@ +--TEST-- +Dynamic access of constants +--FILE-- + +===DONE=== +--EXPECTF-- +foo + +Fatal error: Class 'B' not found in %s042.php on line %d diff --git a/tests/lang/043.phpt b/tests/lang/043.phpt new file mode 100644 index 0000000..7ca2d74 --- /dev/null +++ b/tests/lang/043.phpt @@ -0,0 +1,19 @@ +--TEST-- +Dynamic call for static methods +--FILE-- + +===DONE=== +--EXPECTF-- +foo + +Fatal error: Class 'B' not found in %s043.php on line %d diff --git a/tests/lang/044.phpt b/tests/lang/044.phpt new file mode 100644 index 0000000..a0de889 --- /dev/null +++ b/tests/lang/044.phpt @@ -0,0 +1,21 @@ +--TEST-- +Dynamic call for static methods dynamically named +--FILE-- + +===DONE=== +--EXPECTF-- +foo + +Fatal error: Class 'B' not found in %s044.php on line %d diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt new file mode 100644 index 0000000..11598cf --- /dev/null +++ b/tests/lang/045.phpt @@ -0,0 +1,27 @@ +--TEST-- +Timeout again inside register_shutdown_function +--SKIPIF-- + +--FILE-- + 2) { + echo "Failed!"; + break; + } + } +} +plop(); +?> +===DONE=== +--EXPECTF-- +Fatal error: Maximum execution time of 1 second exceeded in %s on line %d + +Fatal error: Maximum execution time of 1 second exceeded in %s on line %d diff --git a/tests/lang/array_shortcut_001.phpt b/tests/lang/array_shortcut_001.phpt new file mode 100644 index 0000000..18a10ea --- /dev/null +++ b/tests/lang/array_shortcut_001.phpt @@ -0,0 +1,13 @@ +--TEST-- +Square bracket array shortcut test +--FILE-- + +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 +) diff --git a/tests/lang/array_shortcut_002.phpt b/tests/lang/array_shortcut_002.phpt new file mode 100644 index 0000000..25aee9b --- /dev/null +++ b/tests/lang/array_shortcut_002.phpt @@ -0,0 +1,13 @@ +--TEST-- +Square bracket associative array shortcut test +--FILE-- + "orange", "bar" => "apple", "baz" => "lemon"]); +?> +--EXPECT-- +Array +( + [foo] => orange + [bar] => apple + [baz] => lemon +) diff --git a/tests/lang/array_shortcut_003.phpt b/tests/lang/array_shortcut_003.phpt new file mode 100644 index 0000000..75e428b --- /dev/null +++ b/tests/lang/array_shortcut_003.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing array shortcut and bracket operator +--FILE-- + +--EXPECT-- +Array +( + [0] => 2 + [1] => 4 +) diff --git a/tests/lang/array_shortcut_005.phpt b/tests/lang/array_shortcut_005.phpt new file mode 100644 index 0000000..7cc7386 --- /dev/null +++ b/tests/lang/array_shortcut_005.phpt @@ -0,0 +1,20 @@ +--TEST-- +Testing nested array shortcut +--FILE-- + "orange", "bar" => "apple", "baz" => "lemon"]]); +?> +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 + [3] => Array + ( + [foo] => orange + [bar] => apple + [baz] => lemon + ) + +) diff --git a/tests/lang/bison1.phpt b/tests/lang/bison1.phpt new file mode 100644 index 0000000..3571576 --- /dev/null +++ b/tests/lang/bison1.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bison weirdness +--FILE-- + +--EXPECT-- +blah- diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt new file mode 100644 index 0000000..0cb3bf4 --- /dev/null +++ b/tests/lang/bug17115.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #17115 (lambda functions produce segfault with static vars) +--FILE-- + +--EXPECT-- +int(0) +int(1) +int(2) diff --git a/tests/lang/bug18872.phpt b/tests/lang/bug18872.phpt new file mode 100644 index 0000000..2e3dc22 --- /dev/null +++ b/tests/lang/bug18872.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #18872 (class constant used as default parameter) +--FILE-- + +--EXPECT-- +3 +3 diff --git a/tests/lang/bug19566.phpt b/tests/lang/bug19566.phpt new file mode 100644 index 0000000..45c3bc5 --- /dev/null +++ b/tests/lang/bug19566.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #19566 (get_declared_classes() segfaults) +--FILE-- + +--EXPECTF-- +int(%d) diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt new file mode 100644 index 0000000..c951190 --- /dev/null +++ b/tests/lang/bug19943.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #19943 (memleaks) +--FILE-- + +--EXPECT-- +0 -- 0 +1 -- 1 +2 -- 2 +3 -- 3 +4 -- 4 +5 -- 5 +6 -- 6 +7 -- 7 +8 -- 8 +9 -- 9 +string(10) "0123456780" diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt new file mode 100644 index 0000000..7c6ec78 --- /dev/null +++ b/tests/lang/bug20175.phpt @@ -0,0 +1,169 @@ +--TEST-- +Bug #20175 (Static vars can't store ref to new instance) +--SKIPIF-- + +--INI-- +error_reporting=E_ALL | E_STRICT | E_DEPRECATED +--FILE-- +oop_name = 'oop:' . ++$oop_global; + } +} + +class oop_test { + static $oop_value; + + function oop_test() { + echo "oop_test()\n"; + } + + function oop_static() { + echo "oop_static()\n"; + if (!isset(self::$oop_value)) { + self::$oop_value = & new oop_class; + } + echo self::$oop_value->oop_name; + } +} + +print foo_static()."\n"; +print foo_static()."\n"; +print bar_static()."\n"; +print bar_static()."\n"; +//print wow_static()."\n"; +//print wow_static()."\n"; +echo "wow_static() +wow_global() +wow:1 +wow_static() +wow:1 +"; +$oop_tester = new oop_test; +print $oop_tester->oop_static()."\n"; +print $oop_tester->oop_static()."\n"; +$oop_tester = new oop_test; // repeated. +print $oop_tester->oop_static()."\n"; +?> +--EXPECTF-- +Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line %d +%s +foo_static() +foo_global() +foo:1 +foo_static() +foo:1 +bar_static() +bar_global() + +Strict Standards: Only variables should be assigned by reference in %sbug20175.php on line 47 +bar:1 +bar_static() +bar:1 +wow_static() +wow_global() +wow:1 +wow_static() +wow:1 +oop_test() +oop_static() +oop_class() +oop:1 +oop_static() +oop:1 +oop_test() +oop_static() +oop:1 diff --git a/tests/lang/bug21094.phpt b/tests/lang/bug21094.phpt new file mode 100644 index 0000000..266a1d6 --- /dev/null +++ b/tests/lang/bug21094.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #21094 (set_error_handler not accepting methods) +--FILE-- + +--EXPECTF-- +[1024] errstr: test, errfile: %s, errline: %d + diff --git a/tests/lang/bug21600.phpt b/tests/lang/bug21600.phpt new file mode 100644 index 0000000..6ecf69a --- /dev/null +++ b/tests/lang/bug21600.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #21600 (assign by reference function call changes variable contents) +--INI-- +error_reporting=4095 +--FILE-- + +--EXPECTF-- +Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4 +array(1) { + ["foo"]=> + string(4) "test" +} + +Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11 +array(1) { + ["foo"]=> + string(4) "test" +} diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt new file mode 100644 index 0000000..643b069 --- /dev/null +++ b/tests/lang/bug21669.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #21669 ("$obj = new $this->var;" doesn't work) +--FILE-- +name; /* Parse error */ + return $obj; + } +} +$factory = new Factory; +$test = $factory->create(); +$test->say_hello(); +?> +--EXPECT-- +Hello world diff --git a/tests/lang/bug21820.phpt b/tests/lang/bug21820.phpt new file mode 100644 index 0000000..cbf466e --- /dev/null +++ b/tests/lang/bug21820.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #21820 ("$arr['foo']" generates bogus E_NOTICE, should be E_PARSE) +--FILE-- + 'bar'); +echo "$arr['foo']"; + +?> +--EXPECTF-- +Parse error: %s error, %s(T_STRING)%s(T_VARIABLE)%s(T_NUM_STRING)%sin %sbug21820.php on line %d diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt new file mode 100644 index 0000000..30b3113 --- /dev/null +++ b/tests/lang/bug21849.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #21849 (self::constant doesn't work as method's default parameter) +--FILE-- + +--EXPECT-- +fubar diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt new file mode 100644 index 0000000..24581d6 --- /dev/null +++ b/tests/lang/bug21961.phpt @@ -0,0 +1,58 @@ +--TEST-- +Bug #21961 (get_parent_class() segfault) +--SKIPIF-- + +--FILE-- +name = 'Mr. X'; + $this->bars = array(); + } + + function getdrunk($where) + { + $this->bars[] = new bar($where); + } + + function getName() + { + return $this->name; + } +} + +class bar extends man +{ + public $name; + + function bar($w) + { + $this->name = $w; + } + + function getName() + { + return $this->name; + } + + function whosdrunk() + { + $who = get_parent_class($this); + if($who == NULL) + { + return 'nobody'; + } + return eval("return ".$who.'::getName();'); + } +} + +$x = new man; +$x->getdrunk('The old Tavern'); +var_dump($x->bars[0]->whosdrunk()); +?> +--EXPECT-- +string(14) "The old Tavern" diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt new file mode 100644 index 0000000..ede6a37 --- /dev/null +++ b/tests/lang/bug22231.phpt @@ -0,0 +1,42 @@ +--TEST-- +Bug #22231 (segfault when returning a global variable by reference) +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +fubar); +unset($bar); +$bar = &foo(); +var_dump($bar->fubar); + +$foo = &foo(); +var_dump($foo); +var_dump($foo->fubar); +unset($foo); +$foo = &foo(); +var_dump($foo->fubar); +?> +--EXPECTF-- +Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d +object(foo)#%d (1) { + ["fubar"]=> + string(5) "fubar" +} +string(5) "fubar" +string(5) "fubar" +object(foo)#%d (1) { + ["fubar"]=> + string(5) "fubar" +} +string(5) "fubar" +string(5) "fubar" diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt new file mode 100644 index 0000000..fd71714 --- /dev/null +++ b/tests/lang/bug22510.phpt @@ -0,0 +1,126 @@ +--TEST-- +Bug #22510 (segfault among complex references) +--INI-- +error_reporting=E_ALL | E_DEPRECATED +--FILE-- +list; + } + + function &method1() { + print __CLASS__."::".__FUNCTION__."\n"; + return @$this->foo; + } + + function &method2() { + print __CLASS__."::".__FUNCTION__."\n"; + return $this->foo; + } + + function method3() { + print __CLASS__."::".__FUNCTION__."\n"; + return @$this->foo; + } +} + +class bar +{ + function run1() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method1($this); + $this->instance->method1($this); + } + + function run2() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method2($this); + $this->instance->method2($this); + } + + function run3() { + print __CLASS__."::".__FUNCTION__."\n"; + $this->instance = new foo(); + $this->instance->method3($this); + $this->instance->method3($this); + } +} + +function ouch(&$bar) { + print __FUNCTION__."\n"; + @$a = $a; + $bar->run1(); +} + +function ok1(&$bar) { + print __FUNCTION__."\n"; + $bar->run1(); +} + +function ok2(&$bar) { + print __FUNCTION__."\n"; + @$a = $a; + $bar->run2(); +} + +function ok3(&$bar) { + print __FUNCTION__."\n"; + @$a = $a; + $bar->run3(); +} + +$bar = &new bar(); +ok1($bar); +$bar->instance->finalize(); +print "done!\n"; +ok2($bar); +$bar->instance->finalize(); +print "done!\n"; +ok3($bar); +$bar->instance->finalize(); +print "done!\n"; +ouch($bar); +$bar->instance->finalize(); +print "I'm alive!\n"; +?> +--EXPECTF-- +Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d +ok1 +bar::run1 +foo::method1 + +Notice: Only variable references should be returned by reference in %s on line %d +foo::method1 + +Notice: Only variable references should be returned by reference in %s on line %d +foo::finalize +done! +ok2 +bar::run2 +foo::method2 +foo::method2 +foo::finalize +done! +ok3 +bar::run3 +foo::method3 +foo::method3 +foo::finalize +done! +ouch +bar::run1 +foo::method1 + +Notice: Only variable references should be returned by reference in %s on line %d +foo::method1 + +Notice: Only variable references should be returned by reference in %s on line %d +foo::finalize +I'm alive! diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt new file mode 100644 index 0000000..2705841 --- /dev/null +++ b/tests/lang/bug22592.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #22592 (cascading assignments to strings with curly braces broken) +--FILE-- + +--EXPECT-- +string(5) "* *-*" +string(7) "* *-* *" +string(7) "*4*-* *" +string(7) "*4*s* *" +string(8) "*4*s* *0" +string(8) "*-*-* *0" +string(8) "*-*s*s*0" +string(8) "4-4s4s*0" +string(9) "4-4s4s505" +string(9) "454s4s505" +string(1) "-" +string(1) "s" +string(1) "4" +string(1) "5" +string(1) "5" +[Illegal string offset: -1] diff --git a/tests/lang/bug22690.phpt b/tests/lang/bug22690.phpt new file mode 100644 index 0000000..6aed5be --- /dev/null +++ b/tests/lang/bug22690.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #22690 (ob_start() is broken with create_function() callbacks) +--FILE-- + +bar +--EXPECT-- +BAR +BAR diff --git a/tests/lang/bug23279.phpt b/tests/lang/bug23279.phpt new file mode 100644 index 0000000..78d7850 --- /dev/null +++ b/tests/lang/bug23279.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #23279 (exception handler stops after first function call) +--FILE-- + +--EXPECT-- +Goodbye Cruel World diff --git a/tests/lang/bug23384.phpt b/tests/lang/bug23384.phpt new file mode 100644 index 0000000..382bdfe --- /dev/null +++ b/tests/lang/bug23384.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #23384 (use of class constants in statics) +--INI-- +error_reporting=4095 +--FILE-- + 'ten'); + static $arr = array(Foo::HUN => 'ten'); + + print_r($arr); + print_r($arr2); + print_r($x); + } +} + +Foo::test(); +echo Foo::HUN."\n"; +?> +--EXPECTF-- +Strict Standards: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d +Array +( + [100] => ten +) +Array +( + [10] => ten +) +100100 diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt new file mode 100644 index 0000000..645bb1b --- /dev/null +++ b/tests/lang/bug23489.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #23489 (ob_start() is broken with method callbacks) +--FILE-- + +failure +--EXPECT-- +success diff --git a/tests/lang/bug23524.phpt b/tests/lang/bug23524.phpt new file mode 100644 index 0000000..512c714 --- /dev/null +++ b/tests/lang/bug23524.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #23524 (Improper handling of constants in array indices) +--FILE-- +THE_CONST)) { + print_r($a); + } + f(); + f(); + f(); + echo "Done"; +?> +--EXPECT-- +Begin +Array +( + [123] => 123 +) +Array +( + [123] => 123 +) +Array +( + [123] => 123 +) +Done diff --git a/tests/lang/bug23584.phpt b/tests/lang/bug23584.phpt new file mode 100644 index 0000000..417cfb0 --- /dev/null +++ b/tests/lang/bug23584.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #23584 (error line numbers off by one when using #!php) +--FILE-- +#!php + +--EXPECTREGEX-- +Notice: Undefined variable:.*foo in .* on line 6 diff --git a/tests/lang/bug23624.phpt b/tests/lang/bug23624.phpt new file mode 100644 index 0000000..4ddb82e --- /dev/null +++ b/tests/lang/bug23624.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #23624 (foreach leaves current array key as null) +--FILE-- + $value); + var_dump(current($arr)); +?> +--EXPECT-- +string(3) "one" +bool(false) diff --git a/tests/lang/bug23922.phpt b/tests/lang/bug23922.phpt new file mode 100644 index 0000000..1fc6e54 --- /dev/null +++ b/tests/lang/bug23922.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #23922 (scope doesn't properly propagate into internal functions) +--FILE-- +foo == 1'); } + + function as_expr() + { assert($this->foo == 1); } + } + + $foo = new foo(); + $foo->as_expr(); + $foo->as_string(); +?> +--EXPECT-- diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt new file mode 100644 index 0000000..fc51c83 --- /dev/null +++ b/tests/lang/bug24054.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #24054 (Assignment operator *= broken) +--FILE-- + 1, 'b' => 2, 'c' => 3); + +foreach($arr as $k=>$v) { + global $$k; // comment this out and it works in PHP 5 too.. + + echo "($k => $v)\n"; + + $$k = $v; +} +?> +--EXPECT-- +(a => 1) +(b => 2) +(c => 3) diff --git a/tests/lang/bug24403.phpt b/tests/lang/bug24403.phpt new file mode 100644 index 0000000..fe99257 --- /dev/null +++ b/tests/lang/bug24403.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #24403 (scope doesn't properly propagate into internal functions) +--FILE-- +a) ? '\'.\$p[\'\\1\'].\'' : +'\'.\$r[\'\\1\'].\'')", + "{a} b {c}"); + } +} +new a(); +?> +--EXPECT-- diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt new file mode 100644 index 0000000..b0cfbe0 --- /dev/null +++ b/tests/lang/bug24436.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #24436 (isset() and empty() produce errors with non-existent variables in objects) +--FILE-- +test[0][0])) { print "test1";} + if (!isset($this->test[0][0])) { print "test2";} + } +} + +$test1 = new test(); +?> +--EXPECT-- +test1test2 diff --git a/tests/lang/bug24499.phpt b/tests/lang/bug24499.phpt new file mode 100644 index 0000000..6ce56db --- /dev/null +++ b/tests/lang/bug24499.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #24499 (bogus handling of a public property as a private one) +--FILE-- +id = "bar"; + } +} + +$id = new Id(); +@$obj->foo = "bar"; +$id->tester($obj); +print_r($obj); +?> +--EXPECT-- +stdClass Object +( + [foo] => bar + [id] => bar +) diff --git a/tests/lang/bug24573.phpt b/tests/lang/bug24573.phpt new file mode 100644 index 0000000..e087d1f --- /dev/null +++ b/tests/lang/bug24573.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #24573 (debug_backtrace() crashes if $this is set to null) +--FILE-- +Bar(); + +echo "OK\n"; + +?> +--EXPECTF-- + +Fatal error: Cannot re-assign $this in %s on line %d \ No newline at end of file diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt new file mode 100644 index 0000000..919b38e --- /dev/null +++ b/tests/lang/bug24640.phpt @@ -0,0 +1,129 @@ +--TEST-- +Bug #24640 (var_export and var_dump can't output large float) +--INI-- +precision=12 +--FILE-- + +===DONE=== + +--EXPECTF-- +1.7E+300 +float(1.7E+300) +1.7E+300 +1.7E+300 +------ +1.7E-300 +float(1.7E-300) +1.7E-300 +1.7E-300 +------ +1.7E+79 +float(1.7E+79) +1.7E+79 +1.7E+79 +------ +1.7E-79 +float(1.7E-79) +1.7E-79 +1.7E-79 +------ +1.7E+80 +float(1.7E+80) +1.7E+80 +1.7E+80 +------ +1.7E-80 +float(1.7E-80) +1.7E-80 +1.7E-80 +------ +1.7E+81 +float(1.7E+81) +1.7E+81 +1.7E+81 +------ +1.7E-81 +float(1.7E-81) +1.7E-81 +1.7E-81 +------ +I%s +float(I%s) +I%s +I%s +------ +1.69998107421E-319 +float(1.69998107421E-319) +1.69998107421E-319 +1.69998107421E-319 +------ +I%s +float(I%s) +I%s +I%s +------ +1.70007988734E-320 +float(1.70007988734E-320) +1.70007988734E-320 +1.70007988734E-320 +------ +I%s +float(I%s) +I%s +I%s +------ +1.69958582169E-321 +float(1.69958582169E-321) +1.69958582169E-321 +1.69958582169E-321 +------ +I%s +float(I%s) +I%s +I%s +------ +0 +float(0) +0 +0 +------ +I%s +float(I%s) +I%s +I%s +------ +0 +float(0) +0 +0 +------ +===DONE=== diff --git a/tests/lang/bug24652.phpt b/tests/lang/bug24652.phpt new file mode 100644 index 0000000..3bcea0e --- /dev/null +++ b/tests/lang/bug24652.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #24652 (broken array_flip()) +--FILE-- + 0); + var_dump($f); + var_dump(array_key_exists(7, $f)); + var_dump(array_key_exists('7', $f)); + + print "----------\n"; + /* This doesn't */ + $f = array_flip(array('7')); + var_dump($f); + var_dump(array_key_exists(7, $f)); + var_dump(array_key_exists('7', $f)); +?> +--EXPECT-- +array(1) { + [7]=> + int(0) +} +bool(true) +bool(true) +---------- +array(1) { + [7]=> + int(0) +} +bool(true) +bool(true) diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt new file mode 100644 index 0000000..944fe44 --- /dev/null +++ b/tests/lang/bug24658.phpt @@ -0,0 +1,56 @@ +--TEST-- +Bug #24658 (combo of typehint / reference causes crash) +--FILE-- + +--EXPECTF-- +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +object(foo)#%d (0) { +} +===no_typehint=== +object(foo)#%d (0) { +} +int(1) +int(2) +===no_typehint_ref=== +object(foo)#%d (0) { +} +int(1) +int(2) +===typehint=== +object(foo)#%d (0) { +} + +Catchable fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given in %s on line %d diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt new file mode 100644 index 0000000..8c8cd6e --- /dev/null +++ b/tests/lang/bug24783.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)") +--FILE-- + "foo\0bar"); + foreach ($arr as $key => $val) { + echo strlen($key), ': '; + echo urlencode($key), ' => ', urlencode($val), "\n"; + } +?> +--EXPECT-- +7: foo%00bar => foo%00bar diff --git a/tests/lang/bug24908.phpt b/tests/lang/bug24908.phpt new file mode 100644 index 0000000..30056ab --- /dev/null +++ b/tests/lang/bug24908.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #24908 (super-globals can not be used in __destruct()) +--INI-- +variables_order=GPS +--FILE-- + +--EXPECT-- +OK diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt new file mode 100644 index 0000000..3d2cc70 --- /dev/null +++ b/tests/lang/bug24926.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #24926 (lambda function (create_function()) cannot be stored in a class property) +--FILE-- +functions['test'] = $function; + print($this->functions['test']()); // werkt al niet meer + + } +} + +$a = new foo (); + +?> +--EXPECT-- +FOO +FOO diff --git a/tests/lang/bug24951.phpt b/tests/lang/bug24951.phpt new file mode 100644 index 0000000..aa48ab2 --- /dev/null +++ b/tests/lang/bug24951.phpt @@ -0,0 +1,42 @@ +--TEST-- +Bug #24951 (ob_flush() destroys output handler) +--FILE-- + +--EXPECT-- +[Hello from t1 1 Hello from t1 2 ] + +[Hello from t2 1 Hello from t2 2 ] + +Hello from t3 2 ] diff --git a/tests/lang/bug25145.phpt b/tests/lang/bug25145.phpt new file mode 100644 index 0000000..9c53387 --- /dev/null +++ b/tests/lang/bug25145.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #25145 (SEGV on recpt of form input with name like "123[]") +--GET-- +123[]=SEGV +--FILE-- + +--EXPECT-- +array(1) { + [123]=> + array(1) { + [0]=> + string(4) "SEGV" + } +} +Done diff --git a/tests/lang/bug25547.phpt b/tests/lang/bug25547.phpt new file mode 100644 index 0000000..b54f467 --- /dev/null +++ b/tests/lang/bug25547.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #25547 (error_handler and array index with function call) +--FILE-- + +--EXPECT-- +handler(Undefined index: foo) +Array +( + [foo] => 1 +) +Done diff --git a/tests/lang/bug25652.phpt b/tests/lang/bug25652.phpt new file mode 100644 index 0000000..09cfc18 --- /dev/null +++ b/tests/lang/bug25652.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #25652 (Calling Global functions dynamically fails from Class scope) +--FILE-- +arr[0]('testvalue'); + } + } + + $a = new foo (); + $a->bar (); + +?> +--EXPECT-- +testfunc testvalue diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt new file mode 100644 index 0000000..bb030c9 --- /dev/null +++ b/tests/lang/bug25922.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #25922 (SEGV in error_handler when context is destroyed) +--INI-- +error_reporting=2047 +--FILE-- + +--EXPECT-- +Undefined variable: data +Undefined index here: '' diff --git a/tests/lang/bug26182.phpt b/tests/lang/bug26182.phpt new file mode 100644 index 0000000..7417293 --- /dev/null +++ b/tests/lang/bug26182.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #26182 (Object properties created redundantly) +--INI-- +error_reporting=4095 +--FILE-- +x)) { + //just for demo + } + } +} + +$t = new A (); + +print_r($t); + +?> +--EXPECT-- +A Object +( +) diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt new file mode 100644 index 0000000..dae182d --- /dev/null +++ b/tests/lang/bug26696.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #26696 (string index in a switch() crashes with multiple matches) +--FILE-- + +--EXPECT-- +OK +OK diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt new file mode 100644 index 0000000..abb99c3 --- /dev/null +++ b/tests/lang/bug26866.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #26866 (segfault when exception raised in __get) +--FILE-- +bar->get_name(); +} +catch (Exception $E) { + echo "Exception raised!\n"; +} +?> +--EXPECT-- +Exception raised! diff --git a/tests/lang/bug26869.phpt b/tests/lang/bug26869.phpt new file mode 100644 index 0000000..77dd259 --- /dev/null +++ b/tests/lang/bug26869.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #26869 (constant as the key of static array) +--FILE-- + 1); + var_dump($a); + var_dump(isset($a[A])); +?> +--EXPECT-- +array(1) { + [1]=> + int(1) +} +bool(true) diff --git a/tests/lang/bug27354.phpt b/tests/lang/bug27354.phpt new file mode 100644 index 0000000..e10ad9c --- /dev/null +++ b/tests/lang/bug27354.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #27354 (Modulus operator crashes PHP) +--FILE-- + +--EXPECTF-- +int(%i) +int(%i) +int(%i) +int(%i) diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt new file mode 100644 index 0000000..4bcadb7 --- /dev/null +++ b/tests/lang/bug27439.phpt @@ -0,0 +1,76 @@ +--TEST-- +Bug #27439 (foreach() with $this segfaults) +--FILE-- +object = new test_props; + } + + public function getArray() { + return $this->array; + } + + public function getString() { + return $this->string; + } + + public function case1() { + foreach ($this->array as $foo) { + echo $foo; + } + } + + public function case2() { + foreach ($this->foobar as $foo); + } + + public function case3() { + foreach ($this->string as $foo); + } + + public function case4() { + foreach ($this->getArray() as $foo); + } + + public function case5() { + foreach ($this->getString() as $foo); + } + + public function case6() { + foreach ($this->object as $foo) { + echo $foo; + } + } +} +$test = new test(); +$test->case1(); +$test->case2(); +$test->case3(); +$test->case4(); +$test->case5(); +$test->case6(); +echo "\n"; +echo "===DONE==="; +?> +--EXPECTF-- +123 +Notice: Undefined property: test::$foobar in %s on line %d + +Warning: Invalid argument supplied for foreach() in %s on line %d + +Warning: Invalid argument supplied for foreach() in %s on line %d + +Warning: Invalid argument supplied for foreach() in %s on line %d +123 +===DONE=== diff --git a/tests/lang/bug27443.phpt b/tests/lang/bug27443.phpt new file mode 100644 index 0000000..4097943 --- /dev/null +++ b/tests/lang/bug27443.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #27443 (defined() returns wrong type) +--FILE-- + +--EXPECT-- +boolean diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt new file mode 100644 index 0000000..a6ceae7 --- /dev/null +++ b/tests/lang/bug27535.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #27535 (Objects pointing to each other cause Apache to crash) +--FILE-- +storage = new Class1(); + + $this->storage->_Class2_obj = $this; + } +} + +$foo = new Class2(); + +?> +Alive! +--EXPECT-- +Alive! diff --git a/tests/lang/bug28213.phpt b/tests/lang/bug28213.phpt new file mode 100644 index 0000000..3677d4c --- /dev/null +++ b/tests/lang/bug28213.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #28213 (crash in debug_print_backtrace in static methods) +--FILE-- + +--EXPECTREGEX-- +.*#1\s*include.* diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt new file mode 100644 index 0000000..f81ad7f --- /dev/null +++ b/tests/lang/bug28800.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #28800 (Incorrect string to number conversion for strings starting with 'inf') +--FILE-- + +--EXPECT-- +0 +0 +0 +0 +0 +0 + diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt new file mode 100644 index 0000000..16aec8f --- /dev/null +++ b/tests/lang/bug29566.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #29566 (foreach/string handling strangeness) +--FILE-- + +===DONE=== +--EXPECTF-- +Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d + +Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d +===DONE=== diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt new file mode 100644 index 0000000..d320de0 --- /dev/null +++ b/tests/lang/bug29893.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #29893 (segfault when using array as index) +--FILE-- + +===DONE=== +--EXPECTF-- +Warning: Cannot use a scalar value as an array in %sbug29893.php on line %d +===DONE=== diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt new file mode 100644 index 0000000..7882936 --- /dev/null +++ b/tests/lang/bug29944.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #29944 (function defined in switch crashes PHP) +--FILE-- + + +===DONE=== +--EXPECT-- +1 +===DONE=== diff --git a/tests/lang/bug30578.phpt b/tests/lang/bug30578.phpt new file mode 100644 index 0000000..d8a8d2e --- /dev/null +++ b/tests/lang/bug30578.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #30578 (Output buffers flushed before calling __desctruct functions) +--FILE-- + +--EXPECT-- +This should be displayed first. +Buffered data: This should be displayed last. diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt new file mode 100644 index 0000000..945a228 --- /dev/null +++ b/tests/lang/bug30638.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +decimal_point: , +thousands_sep: . diff --git a/tests/lang/bug30726.phpt b/tests/lang/bug30726.phpt new file mode 100644 index 0000000..79aeff7 --- /dev/null +++ b/tests/lang/bug30726.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #30726 (-.1 like numbers are not being handled correctly) +--FILE-- + +--EXPECT-- +1 diff --git a/tests/lang/bug30862.phpt b/tests/lang/bug30862.phpt new file mode 100644 index 0000000..12c95d5 --- /dev/null +++ b/tests/lang/bug30862.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #30862 (Static array with boolean indexes) +--FILE-- +"false", true=>"true"); +} +print_r(T::$a); +?> +---------- +"false", Y=>"true"); +} +print_r(T2::$a); +?> +--EXPECT-- +Array +( + [0] => false + [1] => true +) +---------- +Array +( + [0] => false + [1] => true +) diff --git a/tests/lang/bug32828.phpt b/tests/lang/bug32828.phpt new file mode 100644 index 0000000..ad59646 --- /dev/null +++ b/tests/lang/bug32828.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #32828 (Throwing exception in output_callback function with ob_start and ob_end_clean leads to segfault) +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught exception 'Exception' in %s:%d +Stack trace: +#0 [internal function]: output_handler('', %d) +#1 %s(%d): ob_end_clean() +#2 {main} + thrown in %s on line %d diff --git a/tests/lang/bug32924.phpt b/tests/lang/bug32924.phpt new file mode 100644 index 0000000..d72b0ea --- /dev/null +++ b/tests/lang/bug32924.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #32924 (prepend does not add file to included files) +--INI-- +include_path={PWD} +auto_prepend_file=inc.inc +--FILE-- + +END +--EXPECT-- +Included! +END diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt new file mode 100644 index 0000000..2928f7e --- /dev/null +++ b/tests/lang/bug35176.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #35176 (include()/require()/*_once() produce wrong error messages about main()) +--INI-- +html_errors=1 +docref_root="/" +error_reporting=4095 +--FILE-- + +--EXPECTF-- +
+Warning: require_once(nonexisiting.php) [function.require-once.html]: failed to open stream: No such file or directory in %sbug35176.php on line 2
+
+Fatal error: require_once() [function.require.html]: Failed opening required 'nonexisiting.php' (%s) in %sbug35176.php on line 2
diff --git a/tests/lang/bug35382.phpt b/tests/lang/bug35382.phpt new file mode 100644 index 0000000..69190d4 --- /dev/null +++ b/tests/lang/bug35382.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #35382 (Comment in end of file produces fatal error) +--FILEEOF-- + diff --git a/tests/lang/bug38579.phpt b/tests/lang/bug38579.phpt new file mode 100644 index 0000000..445296c --- /dev/null +++ b/tests/lang/bug38579.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #38579 (include_once() may include the same file twice) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +ok diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt new file mode 100644 index 0000000..bc88bcd --- /dev/null +++ b/tests/lang/bug43958.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #43958 (class name added into the error message) +--FILE-- + +# +# +--EXPECT-- +#1##1 diff --git a/tests/lang/bug44827.phpt b/tests/lang/bug44827.phpt new file mode 100644 index 0000000..031045b --- /dev/null +++ b/tests/lang/bug44827.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #44827 (Class error when trying to access :: as constant) +--CREDITS-- +Sebastian SchÃŒrmann +sebs@php.net +Testfest Munich 2009 +--FILE-- + +--EXPECTF-- +Warning: Class constants cannot be defined or redefined in %s on line %d + +Warning: constant(): Couldn't find constant :: in %s on line %d +NULL + diff --git a/tests/lang/bug45392.phpt b/tests/lang/bug45392.phpt new file mode 100644 index 0000000..78876c7 --- /dev/null +++ b/tests/lang/bug45392.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #45392 (ob_start()/ob_end_clean() and memory_limit) +--INI-- +display_errors=stderr +--SKIPIF-- + +--EXPECTF-- +2 +Fatal error: Allowed memory size of %d bytes exhausted%s diff --git a/tests/lang/bug55754.phpt b/tests/lang/bug55754.phpt new file mode 100644 index 0000000..c58ec91 --- /dev/null +++ b/tests/lang/bug55754.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #55754 (Only variables should be passed by reference for ZEND_SEND_PREFER_REF params) +--FILE-- + "a")); +current(array(0 => "a")); +current($arr); + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt new file mode 100644 index 0000000..ea58061 --- /dev/null +++ b/tests/lang/bug7515.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #7515 (weird & invisible referencing of objects) +--SKIPIF-- + +--INI-- +error_reporting=2039 +--FILE-- +root=new obj(); + +ob_start(); +var_dump($o); +$x=ob_get_contents(); +ob_end_clean(); + +$o->root->method(); + +ob_start(); +var_dump($o); +$y=ob_get_contents(); +ob_end_clean(); +if ($x == $y) { + print "success"; +} else { + print "failure +x=$x +y=$y +"; +} +?> +--EXPECTF-- +Warning: Creating default object from empty value in %s on line %d +success diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt new file mode 100644 index 0000000..f6bbdd9 --- /dev/null +++ b/tests/lang/catchable_error_001.phpt @@ -0,0 +1,22 @@ +--TEST-- +Catchable fatal error [1] +--FILE-- + +--EXPECTF-- +Catchable fatal error: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5 diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt new file mode 100644 index 0000000..c1762b2 --- /dev/null +++ b/tests/lang/catchable_error_002.phpt @@ -0,0 +1,37 @@ +--TEST-- +Catchable fatal error [2] +--FILE-- + +--EXPECTF-- +array(5) { + [0]=> + int(4096) + [1]=> + string(%d) "Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined" + [2]=> + string(%d) "%scatchable_error_002.php" + [3]=> + int(5) + [4]=> + array(0) { + } +} +ALIVE! diff --git a/tests/lang/comments.phpt b/tests/lang/comments.phpt new file mode 100644 index 0000000..ca8b1d2 --- /dev/null +++ b/tests/lang/comments.phpt @@ -0,0 +1,24 @@ +--TEST-- +#-style comments +--FILE-- +#teste +#teste2 + +--EXPECT-- +#teste +#teste2 +#ola +uhm # ah +e este, # hein? diff --git a/tests/lang/comments2.phpt b/tests/lang/comments2.phpt new file mode 100644 index 0000000..8d727d9 --- /dev/null +++ b/tests/lang/comments2.phpt @@ -0,0 +1,9 @@ +--TEST-- +#-style comments (part 2) +--FILEEOF-- + +# +===DONE=== +--EXPECT-- +Simple test for standard compare object handler + +-- The following compare should return TRUE -- +bool(true) + +-- All the following compares should return FALSE -- +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +===DONE=== \ No newline at end of file diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt new file mode 100644 index 0000000..7e4786c --- /dev/null +++ b/tests/lang/compare_objects_basic2.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test object compare when object handler different +--FILE-- + + +===DONE=== +--EXPECTF-- +Simple test comparing two objects with different compare callback handler +bool(false) +===DONE=== diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt new file mode 100644 index 0000000..bb13534 --- /dev/null +++ b/tests/lang/each_binary_safety.phpt @@ -0,0 +1,13 @@ +--TEST-- +Binary safety of each() for both keys and values +--FILE-- + "foo\0bar"); +while (list($key, $val) = each($arr)) { + echo strlen($key), ': '; + echo urlencode($key), ' => ', urlencode($val), "\n"; +} +?> +--EXPECT-- +7: foo%00bar => foo%00bar diff --git a/tests/lang/empty_variation.phpt b/tests/lang/empty_variation.phpt new file mode 100644 index 0000000..8e940da --- /dev/null +++ b/tests/lang/empty_variation.phpt @@ -0,0 +1,14 @@ +--TEST-- +empty() on array elements +--FILE-- +'0'); +var_dump(empty($a['empty'])); +var_dump(empty($a[0])); +$b='0'; +var_dump(empty($b)); +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) diff --git a/tests/lang/engine_assignExecutionOrder_001.phpt b/tests/lang/engine_assignExecutionOrder_001.phpt new file mode 100644 index 0000000..1b85cb7 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_001.phpt @@ -0,0 +1,152 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- +${f()} = g(); +var_dump($oa); + +echo "\n\nOrder with nested object property assignment:\n"; +$ob = new stdClass; +$ob->o1 = new stdClass; +$ob->o1->o2 = new stdClass; +$ob->o1->o2->${f()} = g(); +var_dump($ob); + +echo "\n\nOrder with dim_list property assignment:\n"; +$oc = new stdClass; +$oc->a[${f()}] = g(); +var_dump($oc); + + +class C { + public static $name = "original"; + public static $a = array(); + public static $string = "hello"; +} +echo "\n\nOrder with static property assignment:\n"; +C::${f()} = g(); +var_dump(C::$name); + +echo "\n\nOrder with static array property assignment:\n"; +C::$a[f()] = g(); +var_dump(C::$a); + +echo "\n\nOrder with indexed string assignment:\n"; +$string = "hello"; +function getOffset() { + echo "in getOffset()\n"; + return 0; +} +function newChar() { + echo "in newChar()\n"; + return 'j'; +} +$string[getOffset()] = newChar(); +var_dump($string); + +echo "\n\nOrder with static string property assignment:\n"; +C::$string[getOffset()] = newChar(); +var_dump(C::$string); + +?> +--EXPECTF-- + + +Order with local assignment: +in f() +in g() +%string|unicode%(14) "assigned value" + + +Order with array assignment: +in f() +in g() +array(1) { + [%u|b%"name"]=> + %string|unicode%(14) "assigned value" +} + + +Order with object property assignment: +in f() +in g() +object(stdClass)#%d (1) { + [%u|b%"assigned value"]=> + %string|unicode%(14) "assigned value" +} + + +Order with nested object property assignment: +in f() +in g() +object(stdClass)#%d (1) { + [%u|b%"o1"]=> + object(stdClass)#%d (1) { + [%u|b%"o2"]=> + object(stdClass)#%d (1) { + [%u|b%"assigned value"]=> + %string|unicode%(14) "assigned value" + } + } +} + + +Order with dim_list property assignment: +in f() +in g() +object(stdClass)#%d (1) { + [%u|b%"a"]=> + array(1) { + [%u|b%"assigned value"]=> + %string|unicode%(14) "assigned value" + } +} + + +Order with static property assignment: +in f() +in g() +%string|unicode%(14) "assigned value" + + +Order with static array property assignment: +in f() +in g() +array(1) { + [%u|b%"name"]=> + %string|unicode%(14) "assigned value" +} + + +Order with indexed string assignment: +in getOffset() +in newChar() +%string|unicode%(5) "jello" + + +Order with static string property assignment: +in getOffset() +in newChar() +%string|unicode%(5) "jello" diff --git a/tests/lang/engine_assignExecutionOrder_002.phpt b/tests/lang/engine_assignExecutionOrder_002.phpt new file mode 100644 index 0000000..ba88150 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_002.phpt @@ -0,0 +1,135 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- + +--EXPECTF-- +A=hello B=bye + +Warning: Cannot use a scalar value as an array in %s on line %d +array(2) { + [0]=> + int(10) + [1]=> + int(10) +} +array(2) { + [0]=> + int(30) + [1]=> + int(30) +} +array(3) { + [0]=> + int(1000) + [1]=> + int(2000) + [2]=> + int(3000) +} +L=100 M=200 N=300 +O= and P= +10 20 40 50 60 70 80 + +Notice: Undefined offset: 1 in %s on line %d + +Notice: Undefined offset: 0 in %s on line %d +Y=,Z= + +Notice: Undefined offset: 1 in %s on line %d +AA=10 +CC=10 DD=30 +Array +( + [0] => array created in f() + [array entry created after f()] => Array + ( + [1] => hello + ) + +) diff --git a/tests/lang/engine_assignExecutionOrder_003.phpt b/tests/lang/engine_assignExecutionOrder_003.phpt new file mode 100644 index 0000000..ae3ae78 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_003.phpt @@ -0,0 +1,96 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- + +--EXPECT-- +Good call +Good call +Expect 15 and get...15 +array(2) { + [0]=> + array(1) { + [0]=> + int(10) + } + [1]=> + int(3) +} \ No newline at end of file diff --git a/tests/lang/engine_assignExecutionOrder_004.phpt b/tests/lang/engine_assignExecutionOrder_004.phpt new file mode 100644 index 0000000..86bc87f --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_004.phpt @@ -0,0 +1,52 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- + +--EXPECT-- +i1 +i2 +i3 +i4 +array(6) { + [0]=> + int(10) + [1]=> + int(11) + [2]=> + int(0) + [3]=> + int(30) + [4]=> + int(40) + [5]=> + int(3) +} diff --git a/tests/lang/engine_assignExecutionOrder_005.phpt b/tests/lang/engine_assignExecutionOrder_005.phpt new file mode 100644 index 0000000..6ec03f1 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_005.phpt @@ -0,0 +1,74 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- + +--EXPECT-- +i1 +i2 +i3 +i4 +i5 +i6 +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} diff --git a/tests/lang/engine_assignExecutionOrder_006.phpt b/tests/lang/engine_assignExecutionOrder_006.phpt new file mode 100644 index 0000000..faa34c3 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_006.phpt @@ -0,0 +1,138 @@ +--TEST-- +Evaluation order during assignments. +--FILE-- + +--EXPECT-- +i1 +i2 +i3 +i4 +i5 +i6 +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +i1 +i2 +i3 +i4 +i5 +i6 +array(1) { + [0]=> + array(1) { + [0]=> + int(-2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(-2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +i1 +i2 +i3 +i4 +i5 +i6 +array(1) { + [0]=> + array(1) { + [0]=> + int(-2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} +array(1) { + [0]=> + array(1) { + [0]=> + int(2) + } +} diff --git a/tests/lang/engine_assignExecutionOrder_007.phpt b/tests/lang/engine_assignExecutionOrder_007.phpt new file mode 100644 index 0000000..56b729e --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_007.phpt @@ -0,0 +1,46 @@ +--TEST-- +Check key execution order with &new. +--FILE-- +a =& new $a[$i=2][++$i]; +$o->a->b =& new $a[$i=2][++$i]; +print_r($o); +?> +--EXPECTF-- +Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 3 + +Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 7 + +Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 8 +Array +( + [2] => Array + ( + [3] => stdClass + ) + + [0] => Array + ( + [1] => stdClass Object + ( + ) + + ) + +) +stdClass Object +( + [a] => stdClass Object + ( + [b] => stdClass Object + ( + ) + + ) + +) diff --git a/tests/lang/engine_assignExecutionOrder_008.phpt b/tests/lang/engine_assignExecutionOrder_008.phpt new file mode 100644 index 0000000..1333bcd --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_008.phpt @@ -0,0 +1,81 @@ +--TEST-- +Ensure by value assignments leave temporaries on the stack, for all sorts of assignees. +--FILE-- +p=f(): '; +echo $a[$i->p=f()][++$i->p]; +unset($i); + +echo "\n" . '$i->p->q=f(): '; +echo $a[$i->p->q=f()][++$i->p->q]; +unset($i); + +echo "\n" . '$i->p[0]=f(): '; +echo $a[$i->p[0]=f()][++$i->p[0]]; +unset($i); + +echo "\n" . '$i->p[0]->p=f(): '; +echo $a[$i->p[0]->p=f()][++$i->p[0]->p]; +unset($i); + +Class C { + static $p; +} + +echo "\n" . 'C::$p=f(): '; +echo $a[C::$p=f()][++C::$p]; + +echo "\n" . 'C::$p[0]=f(): '; +C::$p = array(); +echo $a[C::$p[0]=f()][++C::$p[0]]; + +echo "\n" . 'C::$p->q=f(): '; +C::$p = new stdclass; +echo $a[C::$p->q=f()][++C::$p->q]; +?> +--EXPECTF-- +$i=f(): good +$$x=f(): good +${'i'}=f(): good +$i[0]=f(): good +$i[0][0]=f(): good +$i->p=f(): +Warning: Creating default object from empty value in %s on line %d +good +$i->p->q=f(): +Warning: Creating default object from empty value in %s on line %d +good +$i->p[0]=f(): good +$i->p[0]->p=f(): +Warning: Creating default object from empty value in %s on line %d +good +C::$p=f(): good +C::$p[0]=f(): good +C::$p->q=f(): good diff --git a/tests/lang/engine_assignExecutionOrder_009.phpt b/tests/lang/engine_assignExecutionOrder_009.phpt new file mode 100644 index 0000000..e1d5b71 --- /dev/null +++ b/tests/lang/engine_assignExecutionOrder_009.phpt @@ -0,0 +1,36 @@ +--TEST-- +Execution ordering with comparison operators. +--FILE-- + f(++$i)); +var_dump(f($i=0) >= f(++$i)); + +echo "\nArray indices:\n"; +$a[1][2] = 0; +$a[3][4] = 1; +$i=0; +var_dump($a[$i=1][++$i] < $a[++$i][++$i]); +var_dump($a[$i=1][++$i] <= $a[++$i][++$i]); +var_dump($a[$i=1][++$i] > $a[++$i][++$i]); +var_dump($a[$i=1][++$i] >= $a[++$i][++$i]); +?> +--EXPECTF-- +Function call args: +f(0) f(1) bool(true) +f(0) f(1) bool(true) +f(0) f(1) bool(false) +f(0) f(1) bool(false) + +Array indices: +bool(true) +bool(true) +bool(false) +bool(false) diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt new file mode 100644 index 0000000..61f45d4 --- /dev/null +++ b/tests/lang/error_2_exception_001.phpt @@ -0,0 +1,45 @@ +--TEST-- +ZE2 errors caught as exceptions +--SKIPIF-- + +--FILE-- +errno = $_errno; + $this->errmsg = $_errmsg; + } + + function getErrno() { + return $this->errno; + } + + function getErrmsg() { + return $this->errmsg; + } +} + +function ErrorsToExceptions($errno, $errmsg) { + throw new MyException($errno, $errmsg); +} + +set_error_handler("ErrorsToExceptions"); + +// make sure it isn't catching exceptions that weren't +// thrown... + +try { +} catch (MyException $exception) { + echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; +} + +try { + trigger_error("I will become an exception", E_USER_ERROR); +} catch (MyException $exception) { + echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n"; +} + +?> +--EXPECT-- +There was an exception: 256, 'I will become an exception' diff --git a/tests/lang/execution_order.phpt b/tests/lang/execution_order.phpt new file mode 100644 index 0000000..ca3feb3 --- /dev/null +++ b/tests/lang/execution_order.phpt @@ -0,0 +1,198 @@ +--TEST-- +Execution order of variables +--FILE-- +str.($str->str="good"); +echo "3)"; +echo $c; +echo "\r\n"; + +$str->str = "bad"; + +$c = ($str->str="good").$str->str; +echo "4)"; +echo $c; +echo "\r\n"; + +$c = strclass::$statstr.(strclass::$statstr="good"); +echo "5)"; +echo $c; +echo "\r\n"; + +strclass::$statstr = "bad"; + +$c = (strclass::$statstr="good").strclass::$statstr; +echo "6)"; +echo $c; +echo "\r\n"; + + +function foo() { + global $a; + $a = "good"; + return $a; +} + + +$a = "bad"; +echo "7)"; +echo foo() . $a; +echo "\r\n"; + +$a = "bad"; +echo "8)"; +echo $a . foo(); +echo "\r\n"; + +/* other operators */ + +$x = 1; +$z = $x - ($x++); +echo "9)"; +echo $z; +echo "\r\n"; + +$x = 1; +$z = ($x++) - $x; +echo "10)"; +echo $z; +echo "\r\n"; + +$x = 1; +$z = $x - (++$x); +echo "11)"; +echo $z; +echo "\r\n"; + +$x = 1; +$z = (++$x) - $x; +echo "12)"; +echo $z; +echo "\r\n"; + + +$x = 1; +$y = 3; +$z = $x - ($x=$y); +echo "13)"; +echo $z; +echo "\r\n"; + +$x = 1; +$y = 3; +$z = ($x=$y) - $x; +echo "14)"; +echo $z; +echo "\r\n"; + + +$a = 100; +$b = 200; +echo "15)"; +echo $a + ($a=$b); +echo "\r\n"; + +$a = 100; +$b = 200; +echo "16)"; +echo ($a=$b) + $a; +echo "\r\n"; + + +$a = array(100,200); +$i = 0; + +echo "17)"; +echo $a[$i++] + $a[$i++]; +echo "\r\n"; + +$i = -1; +echo "18)"; +echo $a[++$i] + $a[++$i]; +echo "\r\n"; + +$i = 0; +echo "19)"; +echo $a[$i] + ($a[$i]=400); +echo "\r\n"; + + +$a[0] = 100; +echo "20)"; +echo ($a[$i]=400) + $a[$i]; +echo "\r\n"; + + +class c { + var $val = 10; + static $stat = 20; +} + +echo "21)"; +echo c::$stat + (c::$stat=200); +echo "\r\n"; + +echo "22)"; +echo (c::$stat=300) + c::$stat; +echo "\r\n"; + +$c = new c(); + +echo "23)"; +echo $c->val + ($c->val=200); +echo "\r\n"; + +echo "24)"; +echo ($c->val=300) + $c->val; +echo "\r\n"; + +?> +--EXPECT-- +1)goodgood +2)goodgood +3)badgood +4)goodgood +5)badgood +6)goodgood +7)goodgood +8)goodgood +9)1 +10)-1 +11)0 +12)0 +13)0 +14)0 +15)400 +16)400 +17)300 +18)300 +19)500 +20)800 +21)220 +22)600 +23)210 +24)600 diff --git a/tests/lang/foreachLoop.001.phpt b/tests/lang/foreachLoop.001.phpt new file mode 100644 index 0000000..164cac6 --- /dev/null +++ b/tests/lang/foreachLoop.001.phpt @@ -0,0 +1,64 @@ +--TEST-- +Foreach loop tests - basic loop with just value and key => value. +--FILE-- + $v) { + var_dump($k, $v); +} +//check key and value after the loop. +var_dump($k, $v); + +echo "\n"; +//Dynamic array +foreach (array("d","e","f") as $v) { + var_dump($v); +} +foreach (array("d","e","f") as $k => $v) { + var_dump($k, $v); +} +//check key and value after the loop. +var_dump($k, $v); + +echo "\n"; +//Ensure counter is advanced during loop +$a=array("a","b","c"); +foreach ($a as $v); +var_dump(current($a)); +$a=array("a","b","c"); +foreach ($a as &$v); +var_dump(current($a)); + +?> +--EXPECT-- +string(1) "a" +string(1) "b" +string(1) "c" +int(0) +string(1) "a" +int(1) +string(1) "b" +int(2) +string(1) "c" +int(2) +string(1) "c" + +string(1) "d" +string(1) "e" +string(1) "f" +int(0) +string(1) "d" +int(1) +string(1) "e" +int(2) +string(1) "f" +int(2) +string(1) "f" + +bool(false) +bool(false) \ No newline at end of file diff --git a/tests/lang/foreachLoop.002.phpt b/tests/lang/foreachLoop.002.phpt new file mode 100644 index 0000000..e3000c7 --- /dev/null +++ b/tests/lang/foreachLoop.002.phpt @@ -0,0 +1,173 @@ +--TEST-- +Foreach loop tests - modifying the array during the loop. +--FILE-- +$v) { + $a[$k]="changed.$k"; + var_dump($v); +} +var_dump($a); + +echo "\nModifying the foreach \$value.\n"; +$a = array("original.1","original.2","original.3"); +foreach ($a as $k=>$v) { + $v="changed.$k"; +} +var_dump($a); + + +echo "\nModifying the foreach &\$value.\n"; +$a = array("original.1","original.2","original.3"); +foreach ($a as $k=>&$v) { + $v="changed.$k"; +} +var_dump($a); + +echo "\nPushing elements onto an unreferenced array.\n"; +$a = array("original.1","original.2","original.3"); +$counter=0; +foreach ($a as $v) { + array_push($a, "new.$counter"); + + //avoid infinite loop if test is failing + if ($counter++>10) { + echo "Loop detected\n"; + break; + } +} +var_dump($a); + +echo "\nPushing elements onto an unreferenced array, using &\$value.\n"; +$a = array("original.1","original.2","original.3"); +$counter=0; +foreach ($a as &$v) { + array_push($a, "new.$counter"); + + //avoid infinite loop if test is failing + if ($counter++>10) { + echo "Loop detected\n"; + break; + } +} +var_dump($a); + +echo "\nPopping elements off an unreferenced array.\n"; +$a = array("original.1","original.2","original.3"); +foreach ($a as $v) { + array_pop($a); + var_dump($v); +} +var_dump($a); + +echo "\nPopping elements off an unreferenced array, using &\$value.\n"; +$a = array("original.1","original.2","original.3"); +foreach ($a as &$v) { + array_pop($a); + var_dump($v); +} +var_dump($a); + +?> +--EXPECT-- + +Directly changing array values. +string(10) "original.1" +string(10) "original.2" +string(10) "original.3" +array(3) { + [0]=> + string(9) "changed.0" + [1]=> + string(9) "changed.1" + [2]=> + string(9) "changed.2" +} + +Modifying the foreach $value. +array(3) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" +} + +Modifying the foreach &$value. +array(3) { + [0]=> + string(9) "changed.0" + [1]=> + string(9) "changed.1" + [2]=> + &string(9) "changed.2" +} + +Pushing elements onto an unreferenced array. +array(6) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" +} + +Pushing elements onto an unreferenced array, using &$value. +Loop detected +array(15) { + [0]=> + string(10) "original.1" + [1]=> + string(10) "original.2" + [2]=> + string(10) "original.3" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" + [9]=> + string(5) "new.6" + [10]=> + string(5) "new.7" + [11]=> + &string(5) "new.8" + [12]=> + string(5) "new.9" + [13]=> + string(6) "new.10" + [14]=> + string(6) "new.11" +} + +Popping elements off an unreferenced array. +string(10) "original.1" +string(10) "original.2" +string(10) "original.3" +array(0) { +} + +Popping elements off an unreferenced array, using &$value. +string(10) "original.1" +string(10) "original.2" +array(1) { + [0]=> + string(10) "original.1" +} \ No newline at end of file diff --git a/tests/lang/foreachLoop.003.phpt b/tests/lang/foreachLoop.003.phpt new file mode 100644 index 0000000..d554d0d --- /dev/null +++ b/tests/lang/foreachLoop.003.phpt @@ -0,0 +1,46 @@ +--TEST-- +Foreach loop tests - error case: not an array. +--FILE-- + +--EXPECTF-- + +Not an array. + +Warning: Invalid argument supplied for foreach() in %s on line 4 + +Warning: Invalid argument supplied for foreach() in %s on line 9 + +Warning: Invalid argument supplied for foreach() in %s on line 14 + +Warning: Invalid argument supplied for foreach() in %s on line 19 + +Warning: Invalid argument supplied for foreach() in %s on line 24 +done. diff --git a/tests/lang/foreachLoop.004.phpt b/tests/lang/foreachLoop.004.phpt new file mode 100644 index 0000000..8cc6094 --- /dev/null +++ b/tests/lang/foreachLoop.004.phpt @@ -0,0 +1,76 @@ +--TEST-- +Foreach loop tests - using an array element as the $value +--FILE-- +$v[0]) { + var_dump($k, $v); +} +var_dump($a); +var_dump($k, $v); +?> +--EXPECT-- +array(1) { + [0]=> + string(1) "a" +} +array(1) { + [0]=> + string(1) "b" +} +array(1) { + [0]=> + string(1) "c" +} +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +array(1) { + [0]=> + string(1) "c" +} + +int(0) +array(1) { + [0]=> + string(1) "a" +} +int(1) +array(1) { + [0]=> + string(1) "b" +} +int(2) +array(1) { + [0]=> + string(1) "c" +} +array(3) { + [0]=> + string(1) "a" + [1]=> + string(1) "b" + [2]=> + string(1) "c" +} +int(2) +array(1) { + [0]=> + string(1) "c" +} \ No newline at end of file diff --git a/tests/lang/foreachLoop.005.phpt b/tests/lang/foreachLoop.005.phpt new file mode 100644 index 0000000..ae6ed3a --- /dev/null +++ b/tests/lang/foreachLoop.005.phpt @@ -0,0 +1,23 @@ +--TEST-- +Foreach loop tests - modifying the array during the loop: special case. Behaviour is good since php 5.2.2. +--FILE-- +&$v){ + $a[$k] = "changed.$k"; + echo "After changing \$a directly, \$v@$k is: $v\n"; +} +//--- Expected output: +//After changing $a directly, $v@0 is: changed.0 +//After changing $a directly, $v@1 is: changed.1 +//After changing $a directly, $v@2 is: changed.2 +//--- Actual output from php.net before 5.2.2: +//After changing $a directly, $v@0 is: changed.0 +//After changing $a directly, $v@1 is: original.1 +//After changing $a directly, $v@2 is: original.2 + +?> +--EXPECT-- +After changing $a directly, $v@0 is: changed.0 +After changing $a directly, $v@1 is: changed.1 +After changing $a directly, $v@2 is: changed.2 diff --git a/tests/lang/foreachLoop.006.phpt b/tests/lang/foreachLoop.006.phpt new file mode 100644 index 0000000..a90f924 --- /dev/null +++ b/tests/lang/foreachLoop.006.phpt @@ -0,0 +1,11 @@ +--TEST-- +Foreach loop tests - error case: key is a reference. +--FILE-- +$v) { + var_dump($v); +} +?> +--EXPECTF-- +Fatal error: Key element cannot be a reference in %s on line 3 \ No newline at end of file diff --git a/tests/lang/foreachLoop.007.phpt b/tests/lang/foreachLoop.007.phpt new file mode 100644 index 0000000..f47fdc7 --- /dev/null +++ b/tests/lang/foreachLoop.007.phpt @@ -0,0 +1,11 @@ +--TEST-- +Foreach loop tests - error case: reference to constant array. +--FILE-- + +--EXPECTF-- +Parse error: %s on line 3 diff --git a/tests/lang/foreachLoop.008.phpt b/tests/lang/foreachLoop.008.phpt new file mode 100644 index 0000000..787f43b --- /dev/null +++ b/tests/lang/foreachLoop.008.phpt @@ -0,0 +1,10 @@ +--TEST-- +Foreach loop tests - error case: reference to constant array, with key. +--FILE-- +&$v) { + var_dump($v); +} +?> +--EXPECTF-- +Fatal error: Cannot create references to elements of a temporary array expression in %s on line 2 diff --git a/tests/lang/foreachLoop.009.phpt b/tests/lang/foreachLoop.009.phpt new file mode 100644 index 0000000..4586a35 --- /dev/null +++ b/tests/lang/foreachLoop.009.phpt @@ -0,0 +1,82 @@ +--TEST-- +Foreach loop tests - foreach operates on the original array if the array is referenced outside the loop. +--FILE-- +$v1) { + array_pop($refedArray); + echo "key: $k; value: $v1\n"; +} + +echo "\nRemove elements from a referenced array during loop, using &\$value\n"; +$refedArray=array("original.0", "original.1", "original.2"); +$ref=&$refedArray; +foreach ($refedArray as $k=>&$v2) { + array_pop($refedArray); + echo "key: $k; value: $v2\n"; +} + +echo "\nAdd elements to a referenced array during loop\n"; +$refedArray=array("original.0", "original.1", "original.2"); +$ref=&$refedArray; +$count=0; +foreach ($refedArray as $k=>$v3) { + array_push($refedArray, "new.$k"); + echo "key: $k; value: $v3\n"; + + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } +} + +echo "\nAdd elements to a referenced array during loop, using &\$value\n"; +$refedArray=array("original.0", "original.1", "original.2"); +$ref=&$refedArray; +$count=0; +foreach ($refedArray as $k=>&$v4) { + array_push($refedArray, "new.$k"); + echo "key: $k; value: $v4\n"; + + if ($count++>5) { + echo "Loop detected, as expected.\n"; + break; + } +} + +?> +--EXPECT-- + +Remove elements from a referenced array during loop +key: 0; value: original.0 +key: 1; value: original.1 + +Remove elements from a referenced array during loop, using &$value +key: 0; value: original.0 +key: 1; value: original.1 + +Add elements to a referenced array during loop +key: 0; value: original.0 +key: 1; value: original.1 +key: 2; value: original.2 +key: 3; value: new.0 +key: 4; value: new.1 +key: 5; value: new.2 +key: 6; value: new.3 +Loop detected, as expected. + +Add elements to a referenced array during loop, using &$value +key: 0; value: original.0 +key: 1; value: original.1 +key: 2; value: original.2 +key: 3; value: new.0 +key: 4; value: new.1 +key: 5; value: new.2 +key: 6; value: new.3 +Loop detected, as expected. + diff --git a/tests/lang/foreachLoop.010.phpt b/tests/lang/foreachLoop.010.phpt new file mode 100644 index 0000000..a7a3e97 --- /dev/null +++ b/tests/lang/foreachLoop.010.phpt @@ -0,0 +1,40 @@ +--TEST-- +This test illustrates the impact of invoking destructors when refcount is decremented to 0 on foreach. +It will pass only if the 'contentious code' in PHPValue.decReferences() is enabled. +--FILE-- +10) { + echo "Infinite loop detected\n"; + break; + } +} + +?> +--EXPECTF-- +int(1) +int(2) +int(3) \ No newline at end of file diff --git a/tests/lang/foreachLoop.011.phpt b/tests/lang/foreachLoop.011.phpt new file mode 100644 index 0000000..94cb605 --- /dev/null +++ b/tests/lang/foreachLoop.011.phpt @@ -0,0 +1,34 @@ +--TEST-- +Changing from an interable type to a non iterable type during the iteration +--FILE-- +a=1; +$a->b=2; +$b=&$a; +foreach ($a as $v) { + var_dump($v); + $b='x'; +} + +?> +--EXPECTF-- + +Change from array to non iterable: +int(1) + +Warning: Invalid argument supplied for foreach() in %s on line 5 + +Change from object to non iterable: +int(1) + +Warning: Invalid argument supplied for foreach() in %s on line 15 \ No newline at end of file diff --git a/tests/lang/foreachLoop.012.phpt b/tests/lang/foreachLoop.012.phpt new file mode 100644 index 0000000..1165b74 --- /dev/null +++ b/tests/lang/foreachLoop.012.phpt @@ -0,0 +1,494 @@ +--TEST-- +Directly modifying an unreferenced array when foreach'ing over it. +--FILE-- + State of array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); +} + + +echo "\nPopping elements off end of an unreferenced array"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of an unreferenced array"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of an unreferenced array"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of an unreferenced array"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of an unreferenced array"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- + +Popping elements off end of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" +} + + + +Adding elements to the start of an unreferenced array +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(4) { + [0]=> + string(5) "new.1" + [1]=> + string(5) "new.0" + [2]=> + string(3) "v.0" + [3]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(6) { + [0]=> + string(5) "new.2" + [1]=> + string(5) "new.1" + [2]=> + string(5) "new.0" + [3]=> + string(3) "v.0" + [4]=> + string(3) "v.1" + [5]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.3" + [1]=> + string(5) "new.2" + [2]=> + string(5) "new.1" + [3]=> + string(5) "new.0" + [4]=> + string(3) "v.0" + [5]=> + string(3) "v.1" + [6]=> + string(3) "v.2" + [7]=> + string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.013.phpt b/tests/lang/foreachLoop.013.phpt new file mode 100644 index 0000000..3dec119 --- /dev/null +++ b/tests/lang/foreachLoop.013.phpt @@ -0,0 +1,555 @@ +--TEST-- +Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax. +--FILE-- + State of array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>&$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); +} + + +echo "\nPopping elements off end of an unreferenced array, using &\$value."; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of an unreferenced array, using &\$value."; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of an unreferenced array, using &\$value."; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of an unreferenced array, using &\$value."; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of an unreferenced array, using &\$value."; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- + +Popping elements off end of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(1) { + [0]=> + string(3) "v.0" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=0; $v=v.0 + iteration 3: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 + iteration 3: $k=0; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + &string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=new.0 + iteration 3: $k=3; $v=new.1 + iteration 4: $k=4; $v=new.2 + iteration 5: $k=5; $v=new.3 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" + [4]=> + string(5) "new.2" + [5]=> + &string(5) "new.3" + [6]=> + string(5) "new.4" + [7]=> + string(5) "new.5" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=new.0 + iteration 4: $k=4; $v=new.1 + iteration 5: $k=5; $v=new.2 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + &string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 + iteration 4: $k=4; $v=new.0 + iteration 5: $k=5; $v=new.1 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + &string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" + [8]=> + string(5) "new.4" + [9]=> + string(5) "new.5" +} + + + +Adding elements to the start of an unreferenced array, using &$value. +---( Array with 1 element(s): )--- +--> State of array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + &string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" + [9]=> + string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.014.phpt b/tests/lang/foreachLoop.014.phpt new file mode 100644 index 0000000..ab3c657 --- /dev/null +++ b/tests/lang/foreachLoop.014.phpt @@ -0,0 +1,556 @@ +--TEST-- +Directly modifying a REFERENCED array when foreach'ing over it. +--FILE-- + State of referenced array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); +} + + +echo "\nPopping elements off end of a referenced array"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of a referenced array"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of a referenced array"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of a referenced array"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of a referenced array"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- +Popping elements off end of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(1) { + [0]=> + string(3) "v.0" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=0; $v=v.0 + iteration 3: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 + iteration 3: $k=0; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=new.0 + iteration 3: $k=3; $v=new.1 + iteration 4: $k=4; $v=new.2 + iteration 5: $k=5; $v=new.3 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" + [4]=> + string(5) "new.2" + [5]=> + string(5) "new.3" + [6]=> + string(5) "new.4" + [7]=> + string(5) "new.5" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=new.0 + iteration 4: $k=4; $v=new.1 + iteration 5: $k=5; $v=new.2 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 + iteration 4: $k=4; $v=new.0 + iteration 5: $k=5; $v=new.1 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" + [8]=> + string(5) "new.4" + [9]=> + string(5) "new.5" +} + + + +Adding elements to the start of a referenced array +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.5" + [1]=> + string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(5) "new.5" + [1]=> + string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(5) "new.5" + [1]=> + string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" + [9]=> + string(3) "v.3" +} \ No newline at end of file diff --git a/tests/lang/foreachLoop.015.phpt b/tests/lang/foreachLoop.015.phpt new file mode 100644 index 0000000..dfba159 --- /dev/null +++ b/tests/lang/foreachLoop.015.phpt @@ -0,0 +1,557 @@ +--TEST-- +Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax. +--FILE-- + State of referenced array before loop:\n"; + var_dump($a); + + echo "--> Do loop:\n"; + foreach ($a as $k=>&$v) { + echo " iteration $counter: \$k=$k; \$v=$v\n"; + eval($transform); + $counter++; + if ($counter>MAX_LOOPS) { + echo " ** Stuck in a loop! **\n"; + break; + } + } + + echo "--> State of array after loop:\n"; + var_dump($a); +} + + +echo "\nPopping elements off end of a referenced array, using &\$value"; +$transform = 'array_pop($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nShift elements off start of a referenced array, using &\$value"; +$transform = 'array_shift($a);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nRemove current element of a referenced array, using &\$value"; +$transform = 'unset($a[$k]);'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the end of a referenced array, using &\$value"; +$transform = 'array_push($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +echo "\n\n\nAdding elements to the start of a referenced array, using &\$value"; +$transform = 'array_unshift($a, "new.$counter");'; +withRefValue(1, $transform); +withRefValue(2, $transform); +withRefValue(3, $transform); +withRefValue(4, $transform); + +?> +--EXPECTF-- + +Popping elements off end of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(1) { + [0]=> + string(3) "v.0" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=0; $v=v.0 + iteration 3: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + + + +Shift elements off start of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=v.1 + iteration 2: $k=0; $v=v.2 + iteration 3: $k=0; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Remove current element of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(0) { +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 +--> State of array after loop: +array(0) { +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 +--> State of array after loop: +array(0) { +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 +--> State of array after loop: +array(0) { +} + + + +Adding elements to the end of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + &string(3) "v.0" + [1]=> + string(5) "new.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=new.0 + iteration 3: $k=3; $v=new.1 + iteration 4: $k=4; $v=new.2 + iteration 5: $k=5; $v=new.3 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(5) "new.0" + [3]=> + string(5) "new.1" + [4]=> + string(5) "new.2" + [5]=> + &string(5) "new.3" + [6]=> + string(5) "new.4" + [7]=> + string(5) "new.5" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=new.0 + iteration 4: $k=4; $v=new.1 + iteration 5: $k=5; $v=new.2 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(5) "new.0" + [4]=> + string(5) "new.1" + [5]=> + &string(5) "new.2" + [6]=> + string(5) "new.3" + [7]=> + string(5) "new.4" + [8]=> + string(5) "new.5" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=1; $v=v.1 + iteration 2: $k=2; $v=v.2 + iteration 3: $k=3; $v=v.3 + iteration 4: $k=4; $v=new.0 + iteration 5: $k=5; $v=new.1 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" + [4]=> + string(5) "new.0" + [5]=> + &string(5) "new.1" + [6]=> + string(5) "new.2" + [7]=> + string(5) "new.3" + [8]=> + string(5) "new.4" + [9]=> + string(5) "new.5" +} + + + +Adding elements to the start of a referenced array, using &$value +---( Array with 1 element(s): )--- +--> State of referenced array before loop: +array(1) { + [0]=> + string(3) "v.0" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 +--> State of array after loop: +array(2) { + [0]=> + string(5) "new.0" + [1]=> + &string(3) "v.0" +} + +---( Array with 2 element(s): )--- +--> State of referenced array before loop: +array(2) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(8) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" +} + +---( Array with 3 element(s): )--- +--> State of referenced array before loop: +array(3) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(9) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" +} + +---( Array with 4 element(s): )--- +--> State of referenced array before loop: +array(4) { + [0]=> + string(3) "v.0" + [1]=> + string(3) "v.1" + [2]=> + string(3) "v.2" + [3]=> + string(3) "v.3" +} +--> Do loop: + iteration 0: $k=0; $v=v.0 + iteration 1: $k=0; $v=new.0 + iteration 2: $k=0; $v=new.1 + iteration 3: $k=0; $v=new.2 + iteration 4: $k=0; $v=new.3 + iteration 5: $k=0; $v=new.4 + ** Stuck in a loop! ** +--> State of array after loop: +array(10) { + [0]=> + string(5) "new.5" + [1]=> + &string(5) "new.4" + [2]=> + string(5) "new.3" + [3]=> + string(5) "new.2" + [4]=> + string(5) "new.1" + [5]=> + string(5) "new.0" + [6]=> + string(3) "v.0" + [7]=> + string(3) "v.1" + [8]=> + string(3) "v.2" + [9]=> + string(3) "v.3" +} diff --git a/tests/lang/foreachLoop.016.phpt b/tests/lang/foreachLoop.016.phpt new file mode 100644 index 0000000..d570aba --- /dev/null +++ b/tests/lang/foreachLoop.016.phpt @@ -0,0 +1,206 @@ +--TEST-- +Ensure foreach splits the iterated entity from its cow reference set, for all sorts of iterated entities. +--FILE-- +&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '${\'a\'}' . "\n"; + $b = $a = array('original'); + foreach(${'a'} as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$$a' . "\n"; + $a = 'blah'; + $$a = array('original'); + $b = $$a; + foreach($$a as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a[0]' . "\n"; + $b = $a[0] = array('original'); + foreach($a[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a[0][0]' . "\n"; + $b = $a[0][0] = array('original'); + foreach($a[0][0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b' . "\n"; + $b = $a->b = array('original'); + foreach($a->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b->c' . "\n"; + $b = $a->b->c = array('original'); + foreach($a->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0]' . "\n"; + $b = $a->b[0] = array('original'); + foreach($a->b[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0][0]' . "\n"; + $b = $a->b[0][0] = array('original'); + foreach($a->b[0][0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . '$a->b[0]->c' . "\n"; + $b = $a->b[0]->c = array('original'); + foreach($a->b[0]->c as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + class C { + public static $a; + } + + echo "\n" . 'C::$a' . "\n"; + C::$a = array('original'); + $b = C::$a; + foreach(C::$a as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset($a, $b); + + echo "\n" . 'C::$a[0]' . "\n"; + C::$a[0] = array('original'); + $b = C::$a[0]; + foreach(C::$a[0] as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset(C::$a[0], $b); + + echo "\n" . 'C::$a[0]->b' . "\n"; + C::$a[0]->b = array('original'); + $b = C::$a[0]->b; + foreach(C::$a[0]->b as $k=>&$v) { + $v = 'changed'; + } + var_dump($b); + unset(C::$a[0]->b, $b); +?> +--EXPECTF-- + +$a +array(1) { + [0]=> + string(8) "original" +} + +${'a'} +array(1) { + [0]=> + string(8) "original" +} + +$$a +array(1) { + [0]=> + string(8) "original" +} + +$a[0] +array(1) { + [0]=> + string(8) "original" +} + +$a[0][0] +array(1) { + [0]=> + string(8) "original" +} + +$a->b + +Warning: Creating default object from empty value in %s on line %d +array(1) { + [0]=> + string(8) "original" +} + +$a->b->c + +Warning: Creating default object from empty value in %s on line %d +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0] +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0][0] +array(1) { + [0]=> + string(8) "original" +} + +$a->b[0]->c + +Warning: Creating default object from empty value in %s on line %d +array(1) { + [0]=> + string(8) "original" +} + +C::$a +array(1) { + [0]=> + string(8) "original" +} + +C::$a[0] +array(1) { + [0]=> + string(8) "original" +} + +C::$a[0]->b + +Warning: Creating default object from empty value in %s on line %d +array(1) { + [0]=> + string(8) "original" +} diff --git a/tests/lang/foreachLoop.017.phpt b/tests/lang/foreachLoop.017.phpt new file mode 100644 index 0000000..3d2618e --- /dev/null +++ b/tests/lang/foreachLoop.017.phpt @@ -0,0 +1,11 @@ +--TEST-- +Ensure foreach works with arrays with Binary keys. +--FILE-- + 10 ); +foreach ($a as $val=>$key) echo $key; +echo "\nDone\n"; +?> +--EXPECTF-- +10 +Done \ No newline at end of file diff --git a/tests/lang/foreachLoopIterator.001.phpt b/tests/lang/foreachLoopIterator.001.phpt new file mode 100644 index 0000000..c049cb7 --- /dev/null +++ b/tests/lang/foreachLoopIterator.001.phpt @@ -0,0 +1,134 @@ +--TEST-- +foreach with Iterator. +--FILE-- + " . __METHOD__ . " ($this->pos)\n"; + return $this->pos<3; + } + + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos++]; + } + + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } + + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } + + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } + +} + +$f = new MealIterator; +var_dump($f); + +echo "-----( Simple iteration: )-----\n"; +foreach ($f as $k=>$v) { + echo "$k => $v\n"; +} + +$f->rewind(); + +$indent = " "; + +echo "\n\n\n-----( Nested iteration: )-----\n"; +$count=1; +foreach ($f as $k=>$v) { + echo "\nTop level " . $count++ . ": \n"; + echo "$k => $v\n"; + $indent = " "; + foreach ($f as $k=>$v) { + echo " $k => $v\n"; + } + $indent = " "; + +} + +?> +===DONE=== +--EXPECTF-- +object(MealIterator)#%d (2) { + ["pos":"MealIterator":private]=> + int(0) + ["myContent":"MealIterator":private]=> + array(3) { + [0]=> + string(9) "breakfast" + [1]=> + string(5) "lunch" + [2]=> + string(6) "dinner" + } +} +-----( Simple iteration: )----- +--> MealIterator::rewind (0) +--> MealIterator::valid (0) +--> MealIterator::current (0) +--> MealIterator::key (0) +meal 0 => breakfast +--> MealIterator::next (0) +--> MealIterator::valid (1) +--> MealIterator::current (1) +--> MealIterator::key (1) +meal 1 => lunch +--> MealIterator::next (1) +--> MealIterator::valid (2) +--> MealIterator::current (2) +--> MealIterator::key (2) +meal 2 => dinner +--> MealIterator::next (2) +--> MealIterator::valid (3) +--> MealIterator::rewind (3) + + + +-----( Nested iteration: )----- + --> MealIterator::rewind (0) + --> MealIterator::valid (0) + --> MealIterator::current (0) + --> MealIterator::key (0) + +Top level 1: +meal 0 => breakfast + --> MealIterator::rewind (0) + --> MealIterator::valid (0) + --> MealIterator::current (0) + --> MealIterator::key (0) + meal 0 => breakfast + --> MealIterator::next (0) + --> MealIterator::valid (1) + --> MealIterator::current (1) + --> MealIterator::key (1) + meal 1 => lunch + --> MealIterator::next (1) + --> MealIterator::valid (2) + --> MealIterator::current (2) + --> MealIterator::key (2) + meal 2 => dinner + --> MealIterator::next (2) + --> MealIterator::valid (3) + --> MealIterator::next (3) + +Notice: Undefined offset: 3 in %s on line %d + --> MealIterator::valid (4) +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopIterator.002.phpt b/tests/lang/foreachLoopIterator.002.phpt new file mode 100644 index 0000000..f40e09b --- /dev/null +++ b/tests/lang/foreachLoopIterator.002.phpt @@ -0,0 +1,24 @@ +--TEST-- +foreach with iterator and &$value reference +--FILE-- +&$v) { + echo "$k => $v\n"; +} + +?> +--EXPECTF-- +-----( Try to iterate with &$value: )----- + +Fatal error: An iterator cannot be used with foreach by reference in %s on line 13 \ No newline at end of file diff --git a/tests/lang/foreachLoopIteratorAggregate.001.phpt b/tests/lang/foreachLoopIteratorAggregate.001.phpt new file mode 100644 index 0000000..b20d3ea --- /dev/null +++ b/tests/lang/foreachLoopIteratorAggregate.001.phpt @@ -0,0 +1,270 @@ +--TEST-- +foreach with iteratorAggregate +--FILE-- + " . __METHOD__ . " ($this->pos)\n"; + return $this->pos < count($this->myContent); + } + + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos++; + } + + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } + + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } + + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } + +} + +class FrenchMealIterator implements Iterator { + private $pos=0; + private $myContent=array("petit dejeuner", "dejeuner", "gouter", "dinner"); + + public function valid() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->pos < count($this->myContent); + } + + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos++; + } + + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } + + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } + + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } + +} + + +Class EuropeanMeals implements IteratorAggregate { + + private $storedEnglishMealIterator; + private $storedFrenchMealIterator; + + public function __construct() { + $this->storedEnglishMealIterator = new EnglishMealIterator; + $this->storedFrenchMealIterator = new FrenchMealIterator; + } + + public function getIterator() { + global $indent; + echo "$indent--> " . __METHOD__ . "\n"; + + //Alternate between English and French meals + static $i = 0; + if ($i++%2 == 0) { + return $this->storedEnglishMealIterator; + } else { + return $this->storedFrenchMealIterator; + } + } + +} + +$f = new EuropeanMeals; +var_dump($f); + +echo "-----( Simple iteration 1: )-----\n"; +foreach ($f as $k=>$v) { + echo "$k => $v\n"; +} +echo "-----( Simple iteration 2: )-----\n"; +foreach ($f as $k=>$v) { + echo "$k => $v\n"; +} + + +$indent = " "; +echo "\n\n\n-----( Nested iteration: )-----\n"; +$count=1; +foreach ($f as $k=>$v) { + echo "\nTop level " . $count++ . ": \n"; + echo "$k => $v\n"; + $indent = " "; + foreach ($f as $k=>$v) { + echo " $k => $v\n"; + } + $indent = " "; +} + + +?> +===DONE=== +--EXPECTF-- +object(EuropeanMeals)#%d (2) { + ["storedEnglishMealIterator":"EuropeanMeals":private]=> + object(EnglishMealIterator)#%d (2) { + ["pos":"EnglishMealIterator":private]=> + int(0) + ["myContent":"EnglishMealIterator":private]=> + array(3) { + [0]=> + string(9) "breakfast" + [1]=> + string(6) "dinner" + [2]=> + string(3) "tea" + } + } + ["storedFrenchMealIterator":"EuropeanMeals":private]=> + object(FrenchMealIterator)#%d (2) { + ["pos":"FrenchMealIterator":private]=> + int(0) + ["myContent":"FrenchMealIterator":private]=> + array(4) { + [0]=> + string(14) "petit dejeuner" + [1]=> + string(8) "dejeuner" + [2]=> + string(6) "gouter" + [3]=> + string(6) "dinner" + } + } +} +-----( Simple iteration 1: )----- +--> EuropeanMeals::getIterator +--> EnglishMealIterator::rewind (0) +--> EnglishMealIterator::valid (0) +--> EnglishMealIterator::current (0) +--> EnglishMealIterator::key (0) +meal 0 => breakfast +--> EnglishMealIterator::next (0) +--> EnglishMealIterator::valid (1) +--> EnglishMealIterator::current (1) +--> EnglishMealIterator::key (1) +meal 1 => dinner +--> EnglishMealIterator::next (1) +--> EnglishMealIterator::valid (2) +--> EnglishMealIterator::current (2) +--> EnglishMealIterator::key (2) +meal 2 => tea +--> EnglishMealIterator::next (2) +--> EnglishMealIterator::valid (3) +-----( Simple iteration 2: )----- +--> EuropeanMeals::getIterator +--> FrenchMealIterator::rewind (0) +--> FrenchMealIterator::valid (0) +--> FrenchMealIterator::current (0) +--> FrenchMealIterator::key (0) +meal 0 => petit dejeuner +--> FrenchMealIterator::next (0) +--> FrenchMealIterator::valid (1) +--> FrenchMealIterator::current (1) +--> FrenchMealIterator::key (1) +meal 1 => dejeuner +--> FrenchMealIterator::next (1) +--> FrenchMealIterator::valid (2) +--> FrenchMealIterator::current (2) +--> FrenchMealIterator::key (2) +meal 2 => gouter +--> FrenchMealIterator::next (2) +--> FrenchMealIterator::valid (3) +--> FrenchMealIterator::current (3) +--> FrenchMealIterator::key (3) +meal 3 => dinner +--> FrenchMealIterator::next (3) +--> FrenchMealIterator::valid (4) + + + +-----( Nested iteration: )----- + --> EuropeanMeals::getIterator + --> EnglishMealIterator::rewind (3) + --> EnglishMealIterator::valid (0) + --> EnglishMealIterator::current (0) + --> EnglishMealIterator::key (0) + +Top level 1: +meal 0 => breakfast + --> EuropeanMeals::getIterator + --> FrenchMealIterator::rewind (4) + --> FrenchMealIterator::valid (0) + --> FrenchMealIterator::current (0) + --> FrenchMealIterator::key (0) + meal 0 => petit dejeuner + --> FrenchMealIterator::next (0) + --> FrenchMealIterator::valid (1) + --> FrenchMealIterator::current (1) + --> FrenchMealIterator::key (1) + meal 1 => dejeuner + --> FrenchMealIterator::next (1) + --> FrenchMealIterator::valid (2) + --> FrenchMealIterator::current (2) + --> FrenchMealIterator::key (2) + meal 2 => gouter + --> FrenchMealIterator::next (2) + --> FrenchMealIterator::valid (3) + --> FrenchMealIterator::current (3) + --> FrenchMealIterator::key (3) + meal 3 => dinner + --> FrenchMealIterator::next (3) + --> FrenchMealIterator::valid (4) + --> EnglishMealIterator::next (0) + --> EnglishMealIterator::valid (1) + --> EnglishMealIterator::current (1) + --> EnglishMealIterator::key (1) + +Top level 2: +meal 1 => dinner + --> EuropeanMeals::getIterator + --> EnglishMealIterator::rewind (1) + --> EnglishMealIterator::valid (0) + --> EnglishMealIterator::current (0) + --> EnglishMealIterator::key (0) + meal 0 => breakfast + --> EnglishMealIterator::next (0) + --> EnglishMealIterator::valid (1) + --> EnglishMealIterator::current (1) + --> EnglishMealIterator::key (1) + meal 1 => dinner + --> EnglishMealIterator::next (1) + --> EnglishMealIterator::valid (2) + --> EnglishMealIterator::current (2) + --> EnglishMealIterator::key (2) + meal 2 => tea + --> EnglishMealIterator::next (2) + --> EnglishMealIterator::valid (3) + --> EnglishMealIterator::next (3) + --> EnglishMealIterator::valid (4) +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopIteratorAggregate.002.phpt b/tests/lang/foreachLoopIteratorAggregate.002.phpt new file mode 100644 index 0000000..eef4302 --- /dev/null +++ b/tests/lang/foreachLoopIteratorAggregate.002.phpt @@ -0,0 +1,53 @@ +--TEST-- +IteratorAggregate::getIterator bad return type +--FILE-- +$v) { + echo "$k => $v\n"; + } + } catch (Exception $e) { + echo $e->getLine() . ": " . $e->getMessage() ."\n"; + } +} + +f("bad1"); +f("bad2"); +f("bad3"); +f("bad4"); + +?> +===DONE=== +--EXPECTF-- +30: Objects returned by bad1::getIterator() must be traversable or implement interface Iterator +30: Objects returned by bad2::getIterator() must be traversable or implement interface Iterator +30: Objects returned by bad3::getIterator() must be traversable or implement interface Iterator +30: Objects returned by bad4::getIterator() must be traversable or implement interface Iterator +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopIteratorAggregate.003.phpt b/tests/lang/foreachLoopIteratorAggregate.003.phpt new file mode 100644 index 0000000..0a0e23c --- /dev/null +++ b/tests/lang/foreachLoopIteratorAggregate.003.phpt @@ -0,0 +1,133 @@ +--TEST-- +foreach with nested iteratorAggregates +--FILE-- + " . __METHOD__ . " ($this->pos)\n"; + return $this->pos<3; + } + + public function next() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos++]; + } + + public function rewind() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + $this->pos=0; + } + + public function current() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return $this->myContent[$this->pos]; + } + + public function key() { + global $indent; + echo "$indent--> " . __METHOD__ . " ($this->pos)\n"; + return "meal " . $this->pos; + } + +} + +class A1 implements IteratorAggregate { + function getIterator() { + return new EnglishMealIterator; + } +} + +class A2 implements IteratorAggregate { + function getIterator() { + return new A1; + } +} + +class A3 implements IteratorAggregate { + function getIterator() { + return new A2; + } +} + +echo "\n-----( A1: )-----\n"; +foreach (new A1 as $k=>$v) { + echo "$k => $v\n"; +} + +echo "\n-----( A2: )-----\n"; +foreach (new A2 as $k=>$v) { + echo "$k => $v\n"; +} + +echo "\n-----( A3: )-----\n"; +foreach (new A3 as $k=>$v) { + echo "$k => $v\n"; +} + +?> +===DONE=== +--EXPECTF-- +-----( A1: )----- +--> EnglishMealIterator::rewind (0) +--> EnglishMealIterator::valid (0) +--> EnglishMealIterator::current (0) +--> EnglishMealIterator::key (0) +meal 0 => breakfast +--> EnglishMealIterator::next (0) +--> EnglishMealIterator::valid (1) +--> EnglishMealIterator::current (1) +--> EnglishMealIterator::key (1) +meal 1 => dinner +--> EnglishMealIterator::next (1) +--> EnglishMealIterator::valid (2) +--> EnglishMealIterator::current (2) +--> EnglishMealIterator::key (2) +meal 2 => tea +--> EnglishMealIterator::next (2) +--> EnglishMealIterator::valid (3) + +-----( A2: )----- +--> EnglishMealIterator::rewind (0) +--> EnglishMealIterator::valid (0) +--> EnglishMealIterator::current (0) +--> EnglishMealIterator::key (0) +meal 0 => breakfast +--> EnglishMealIterator::next (0) +--> EnglishMealIterator::valid (1) +--> EnglishMealIterator::current (1) +--> EnglishMealIterator::key (1) +meal 1 => dinner +--> EnglishMealIterator::next (1) +--> EnglishMealIterator::valid (2) +--> EnglishMealIterator::current (2) +--> EnglishMealIterator::key (2) +meal 2 => tea +--> EnglishMealIterator::next (2) +--> EnglishMealIterator::valid (3) + +-----( A3: )----- +--> EnglishMealIterator::rewind (0) +--> EnglishMealIterator::valid (0) +--> EnglishMealIterator::current (0) +--> EnglishMealIterator::key (0) +meal 0 => breakfast +--> EnglishMealIterator::next (0) +--> EnglishMealIterator::valid (1) +--> EnglishMealIterator::current (1) +--> EnglishMealIterator::key (1) +meal 1 => dinner +--> EnglishMealIterator::next (1) +--> EnglishMealIterator::valid (2) +--> EnglishMealIterator::current (2) +--> EnglishMealIterator::key (2) +meal 2 => tea +--> EnglishMealIterator::next (2) +--> EnglishMealIterator::valid (3) +===DONE=== diff --git a/tests/lang/foreachLoopIteratorAggregate.004.phpt b/tests/lang/foreachLoopIteratorAggregate.004.phpt new file mode 100644 index 0000000..9a1e612 --- /dev/null +++ b/tests/lang/foreachLoopIteratorAggregate.004.phpt @@ -0,0 +1,104 @@ +--TEST-- +Duplicate of zend test tests/classes/iterators_002.phpt without expected output from destructor +--FILE-- +obj = $obj; + } + function rewind() { + echo __METHOD__ . "\n"; + $this->num = 0; + } + function valid() { + $more = $this->num < $this->obj->max; + echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n"; + return $more; + } + function current() { + echo __METHOD__ . "\n"; + return $this->num; + } + function next() { + echo __METHOD__ . "\n"; + $this->num++; + } + function key() { + echo __METHOD__ . "\n"; + switch($this->num) { + case 0: return "1st"; + case 1: return "2nd"; + case 2: return "3rd"; + default: return "???"; + } + } + function __destruct() { + } +} + +class c implements IteratorAggregate { + + public $max = 3; + + function getIterator() { + echo __METHOD__ . "\n"; + return new c_iter($this); + } + function __destruct() { + } +} + +$t = new c(); + +foreach($t as $k => $v) { + foreach($t as $w) { + echo "double:$v:$w\n"; + break; + } +} + +unset($t); + +?> +===DONE=== +--EXPECT-- +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:0:0 +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:1:0 +c_iter::next +c_iter::valid = true +c_iter::current +c_iter::key +c::getIterator +c_iter::__construct +c_iter::rewind +c_iter::valid = true +c_iter::current +double:2:0 +c_iter::next +c_iter::valid = false +===DONE=== diff --git a/tests/lang/foreachLoopObjects.001.phpt b/tests/lang/foreachLoopObjects.001.phpt new file mode 100644 index 0000000..e6047b7 --- /dev/null +++ b/tests/lang/foreachLoopObjects.001.phpt @@ -0,0 +1,69 @@ +--TEST-- +Foreach loop on objects - basic loop with just value and key => value. +--FILE-- + $v) { + var_dump($k, $v); +} +echo "\nCheck key and value after the loop.\n"; +var_dump($k, $v); + + +echo "\n\nObject instantiated inside loop.\n"; +foreach (new C as $v) { + var_dump($v); +} +foreach (new C as $k => $v) { + var_dump($k, $v); +} +echo "\nCheck key and value after the loop.\n"; +var_dump($k, $v); +?> +--EXPECTF-- + + +Simple loop. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(1) "a" +string(10) "Original a" +string(1) "b" +string(10) "Original b" +string(1) "c" +string(10) "Original c" + +Check key and value after the loop. +string(1) "c" +string(10) "Original c" + + +Object instantiated inside loop. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(1) "a" +string(10) "Original a" +string(1) "b" +string(10) "Original b" +string(1) "c" +string(10) "Original c" + +Check key and value after the loop. +string(1) "c" +string(10) "Original c" \ No newline at end of file diff --git a/tests/lang/foreachLoopObjects.002.phpt b/tests/lang/foreachLoopObjects.002.phpt new file mode 100644 index 0000000..0b06f2b --- /dev/null +++ b/tests/lang/foreachLoopObjects.002.phpt @@ -0,0 +1,587 @@ +--TEST-- +Foreach loop tests - visibility. +--FILE-- +&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + static function doForEach($obj) { + echo "in C::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in C::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + +} + +class D extends C { + + private $f = "Original f"; + protected $g = "Original g"; + + static function doForEach($obj) { + echo "in D::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in D::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } +} + +class E extends D { + public $a = "Overridden a"; + public $b = "Overridden b"; + public $c = "Overridden c"; + protected $d = "Overridden d"; + private $e = "Overridden e"; + + static function doForEach($obj) { + echo "in E::doForEach\n"; + foreach ($obj as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } + + function doForEachOnThis() { + echo "in E::doForEachOnThis\n"; + foreach ($this as $k=>&$v) { + var_dump($v); + $v="changed.$k"; + } + } +} + +echo "\n\nIterate over various generations from within overridden methods:\n"; +echo "\n--> Using instance of C:\n"; +$myC = new C; +$myC->doForEachOnThis(); +var_dump($myC); +echo "\n--> Using instance of D:\n"; +$myD = new D; +$myD->doForEachOnThis(); +var_dump($myD); +echo "\n--> Using instance of E:\n"; +$myE = new E; +$myE->doForEachOnThis(); +var_dump($myE); + +echo "\n\nIterate over various generations from within an inherited method:\n"; +echo "\n--> Using instance of C:\n"; +$myC = new C; +$myC->doForEachC(); +var_dump($myC); +echo "\n--> Using instance of D:\n"; +$myD = new D; +$myD->doForEachC(); +var_dump($myD); +echo "\n--> Using instance of E:\n"; +$myE = new E; +$myE->doForEachC(); +var_dump($myE); + +echo "\n\nIterate over various generations from within an overridden static method:\n"; +echo "\n--> Using instance of C:\n"; +$myC = new C; +C::doForEach($myC); +var_dump($myC); +$myC = new C; +D::doForEach($myC); +var_dump($myC); +$myC = new C; +E::doForEach($myC); +var_dump($myC); +echo "\n--> Using instance of D:\n"; +$myD = new D; +C::doForEach($myD); +var_dump($myD); +$myD = new D; +D::doForEach($myD); +var_dump($myD); +$myD = new D; +E::doForEach($myD); +var_dump($myD); +echo "\n--> Using instance of E:\n"; +$myE = new E; +C::doForEach($myE); +var_dump($myE); +$myE = new E; +D::doForEach($myE); +var_dump($myE); +$myE = new E; +E::doForEach($myE); +var_dump($myE); + + +echo "\n\nIterate over various generations from outside the object:\n"; +echo "\n--> Using instance of C:\n"; +$myC = new C; +foreach ($myC as $k=>&$v) { + var_dump($v); + $v="changed.$k"; +} +var_dump($myC); +echo "\n--> Using instance of D:\n"; +$myD = new D; +foreach ($myD as $k=>&$v) { + var_dump($v); + $v="changed.$k"; +} +var_dump($myD); +echo "\n--> Using instance of E:\n"; +$myE = new E; +foreach ($myE as $k=>&$v) { + var_dump($v); + $v="changed.$k"; +} +var_dump($myE); +?> +===DONE=== +--EXPECTF-- +Iterate over various generations from within overridden methods: + +--> Using instance of C: +in C::doForEachOnThis +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(9) "changed.e" +} + +--> Using instance of D: +in D::doForEachOnThis +string(10) "Original f" +string(10) "Original g" +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +object(D)#%d (7) { + ["f":"D":private]=> + string(9) "changed.f" + ["g":protected]=> + string(9) "changed.g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(10) "Original e" +} + +--> Using instance of E: +in E::doForEachOnThis +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +string(12) "Overridden d" +string(12) "Overridden e" +string(10) "Original g" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"E":private]=> + string(9) "changed.e" + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["e":"C":private]=> + string(10) "Original e" +} + + +Iterate over various generations from within an inherited method: + +--> Using instance of C: +in C::doForEachC +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(9) "changed.e" +} + +--> Using instance of D: +in C::doForEachC +string(10) "Original g" +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(D)#%d (7) { + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(9) "changed.e" +} + +--> Using instance of E: +in C::doForEachC +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +string(12) "Overridden d" +string(10) "Original g" +string(10) "Original e" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"E":private]=> + string(12) "Overridden e" + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["e":"C":private]=> + string(9) "changed.e" +} + + +Iterate over various generations from within an overridden static method: + +--> Using instance of C: +in C::doForEach +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(9) "changed.e" +} +in D::doForEach +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(10) "Original e" +} +in E::doForEach +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(10) "Original e" +} + +--> Using instance of D: +in C::doForEach +string(10) "Original g" +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(D)#%d (7) { + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(9) "changed.e" +} +in D::doForEach +string(10) "Original f" +string(10) "Original g" +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +object(D)#%d (7) { + ["f":"D":private]=> + string(9) "changed.f" + ["g":protected]=> + string(9) "changed.g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(10) "Original e" +} +in E::doForEach +string(10) "Original g" +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +object(D)#%d (7) { + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"C":private]=> + string(10) "Original e" +} + +--> Using instance of E: +in C::doForEach +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +string(12) "Overridden d" +string(10) "Original g" +string(10) "Original e" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"E":private]=> + string(12) "Overridden e" + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["e":"C":private]=> + string(9) "changed.e" +} +in D::doForEach +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +string(12) "Overridden d" +string(10) "Original f" +string(10) "Original g" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"E":private]=> + string(12) "Overridden e" + ["f":"D":private]=> + string(9) "changed.f" + ["g":protected]=> + string(9) "changed.g" + ["e":"C":private]=> + string(10) "Original e" +} +in E::doForEach +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +string(12) "Overridden d" +string(12) "Overridden e" +string(10) "Original g" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(9) "changed.d" + ["e":"E":private]=> + string(9) "changed.e" + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(9) "changed.g" + ["e":"C":private]=> + string(10) "Original e" +} + + +Iterate over various generations from outside the object: + +--> Using instance of C: +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + &string(9) "changed.c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +--> Using instance of D: +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +object(D)#%d (7) { + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(10) "Original g" + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + &string(9) "changed.c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +--> Using instance of E: +string(12) "Overridden a" +string(12) "Overridden b" +string(12) "Overridden c" +object(E)#%d (8) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + &string(9) "changed.c" + ["d":protected]=> + string(12) "Overridden d" + ["e":"E":private]=> + string(12) "Overridden e" + ["f":"D":private]=> + string(10) "Original f" + ["g":protected]=> + string(10) "Original g" + ["e":"C":private]=> + string(10) "Original e" +} +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopObjects.003.phpt b/tests/lang/foreachLoopObjects.003.phpt new file mode 100644 index 0000000..e3747bf --- /dev/null +++ b/tests/lang/foreachLoopObjects.003.phpt @@ -0,0 +1,250 @@ +--TEST-- +Foreach loop tests - modifying the object during the loop. +--FILE-- +$v) { + $obj->$k="changed.$k"; + var_dump($v); +} +var_dump($obj); + +echo "\nModifying the foreach \$value.\n"; +$obj = new C; +foreach ($obj as $k=>$v) { + $v="changed.$k"; +} +var_dump($obj); + + +echo "\nModifying the foreach &\$value.\n"; +$obj = new C; +foreach ($obj as $k=>&$v) { + $v="changed.$k"; +} +var_dump($obj); + +echo "\nAdding properties to an an object.\n"; +$obj = new C; +$counter=0; +foreach ($obj as $v) { + $newPropName = "new$counter"; + $obj->$newPropName = "Added property $counter"; + if ($counter++>10) { + echo "Loop detected\n"; + break; + } + var_dump($v); +} +var_dump($obj); + +echo "\nAdding properties to an an object, using &\$value.\n"; +$obj = new C; +$counter=0; +foreach ($obj as &$v) { + $newPropName = "new$counter"; + $obj->$newPropName = "Added property $counter"; + if ($counter++>10) { + echo "Loop detected\n"; + break; + } + var_dump($v); +} +var_dump($obj); + +echo "\nRemoving properties from an object.\n"; +$obj = new C; +foreach ($obj as $v) { + unset($obj->a); + unset($obj->b); + unset($obj->c); + var_dump($v); +} +var_dump($obj); + +echo "\nRemoving properties from an object, using &\$value.\n"; +$obj = new C; +foreach ($obj as &$v) { + unset($obj->a); + unset($obj->b); + unset($obj->c); + var_dump($v); +} +var_dump($obj); + +?> +===DONE=== +--EXPECTF-- +Directly changing object values. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + string(9) "changed.c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +Modifying the foreach $value. +object(C)#%d (5) { + ["a"]=> + string(10) "Original a" + ["b"]=> + string(10) "Original b" + ["c"]=> + string(10) "Original c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +Modifying the foreach &$value. +object(C)#%d (5) { + ["a"]=> + string(9) "changed.a" + ["b"]=> + string(9) "changed.b" + ["c"]=> + &string(9) "changed.c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +Adding properties to an an object. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(16) "Added property 0" +string(16) "Added property 1" +string(16) "Added property 2" +string(16) "Added property 3" +string(16) "Added property 4" +string(16) "Added property 5" +string(16) "Added property 6" +string(16) "Added property 7" +Loop detected +object(C)#%d (17) { + ["a"]=> + string(10) "Original a" + ["b"]=> + string(10) "Original b" + ["c"]=> + string(10) "Original c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" + ["new0"]=> + string(16) "Added property 0" + ["new1"]=> + string(16) "Added property 1" + ["new2"]=> + string(16) "Added property 2" + ["new3"]=> + string(16) "Added property 3" + ["new4"]=> + string(16) "Added property 4" + ["new5"]=> + string(16) "Added property 5" + ["new6"]=> + string(16) "Added property 6" + ["new7"]=> + string(16) "Added property 7" + ["new8"]=> + string(16) "Added property 8" + ["new9"]=> + string(16) "Added property 9" + ["new10"]=> + string(17) "Added property 10" + ["new11"]=> + string(17) "Added property 11" +} + +Adding properties to an an object, using &$value. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(16) "Added property 0" +string(16) "Added property 1" +string(16) "Added property 2" +string(16) "Added property 3" +string(16) "Added property 4" +string(16) "Added property 5" +string(16) "Added property 6" +string(16) "Added property 7" +Loop detected +object(C)#%d (17) { + ["a"]=> + string(10) "Original a" + ["b"]=> + string(10) "Original b" + ["c"]=> + string(10) "Original c" + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" + ["new0"]=> + string(16) "Added property 0" + ["new1"]=> + string(16) "Added property 1" + ["new2"]=> + string(16) "Added property 2" + ["new3"]=> + string(16) "Added property 3" + ["new4"]=> + string(16) "Added property 4" + ["new5"]=> + string(16) "Added property 5" + ["new6"]=> + string(16) "Added property 6" + ["new7"]=> + string(16) "Added property 7" + ["new8"]=> + &string(16) "Added property 8" + ["new9"]=> + string(16) "Added property 9" + ["new10"]=> + string(17) "Added property 10" + ["new11"]=> + string(17) "Added property 11" +} + +Removing properties from an object. +string(10) "Original a" +object(C)#%d (2) { + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} + +Removing properties from an object, using &$value. +string(10) "Original a" +object(C)#%d (2) { + ["d":protected]=> + string(10) "Original d" + ["e":"C":private]=> + string(10) "Original e" +} +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopObjects.004.phpt b/tests/lang/foreachLoopObjects.004.phpt new file mode 100644 index 0000000..a158ac6 --- /dev/null +++ b/tests/lang/foreachLoopObjects.004.phpt @@ -0,0 +1,55 @@ +--TEST-- +Foreach loop tests - Removing the current element from an iterated object. +--FILE-- +b) { + unset($obj->b); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + + +?> +===DONE=== +--EXPECTF-- +Removing the current element from an iterated object. +string(10) "Original a" +string(10) "Original b" + +Notice: Undefined property: C::$b in %s on line %d +string(10) "Original c" + +Notice: Undefined property: C::$b in %s on line %d +string(10) "Original d" + +Notice: Undefined property: C::$b in %s on line %d +string(10) "Original e" +object(C)#%d (4) { + ["a"]=> + string(10) "Original a" + ["c"]=> + string(10) "Original c" + ["d"]=> + string(10) "Original d" + ["e"]=> + string(10) "Original e" +} +===DONE=== \ No newline at end of file diff --git a/tests/lang/foreachLoopObjects.005.phpt b/tests/lang/foreachLoopObjects.005.phpt new file mode 100644 index 0000000..1692bcd --- /dev/null +++ b/tests/lang/foreachLoopObjects.005.phpt @@ -0,0 +1,78 @@ +--TEST-- +Foreach loop tests - removing properties before and after the current property during the loop. +--FILE-- +a) { + unset($obj->c); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + +echo "\nRemoving properties before the current element from an iterated object.\n"; +$obj = new C; +foreach ($obj as $v) { + if ($v==$obj->b) { + unset($obj->a); + } + var_dump($v); + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + + +?> +--EXPECTF-- + +Removing properties before the current element from an iterated object. +string(10) "Original a" +string(10) "Original b" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (4) { + ["a"]=> + string(10) "Original a" + ["b"]=> + string(10) "Original b" + ["d"]=> + string(10) "Original d" + ["e"]=> + string(10) "Original e" +} + +Removing properties before the current element from an iterated object. +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (4) { + ["b"]=> + string(10) "Original b" + ["c"]=> + string(10) "Original c" + ["d"]=> + string(10) "Original d" + ["e"]=> + string(10) "Original e" +} diff --git a/tests/lang/foreachLoopObjects.006.phpt b/tests/lang/foreachLoopObjects.006.phpt new file mode 100644 index 0000000..8218b44 --- /dev/null +++ b/tests/lang/foreachLoopObjects.006.phpt @@ -0,0 +1,147 @@ +--TEST-- +Foreach loop tests - substituting the entire iterated entity during the loop. +--FILE-- +a = "new a"; +$obj2->b = "new b"; +$obj2->c = "new c"; +$obj2->d = "new d"; +$obj2->e = "new e"; +$obj2->f = "new f"; +$ref = &$obj; +$count=0; +foreach ($obj as $v) { + var_dump($v); + if ($v==$obj->b) { + $ref=$obj2; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + +echo "\nSubstituting the iterated object for an array.\n"; +$obj = new C; +$a = array(1,2,3,4,5,6,7,8); +$ref = &$obj; +$count=0; +foreach ($obj as $v) { + var_dump($v); + if ($v==="Original b") { + $ref=$a; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + +echo "\nSubstituting the iterated array for an object.\n"; +$a = array(1,2,3,4,5,6,7,8); +$obj = new C; +$ref = &$a; +$count=0; +foreach ($a as $v) { + var_dump($v); + if ($v===2) { + $ref=$obj; + } + if (++$count>10) { + echo "Loop detected.\n"; + break; + } +} +var_dump($obj); + +?> +--EXPECTF-- + +Substituting the iterated object for a different object. +string(10) "Original a" +string(10) "Original b" +string(5) "new a" +string(5) "new b" +string(5) "new c" +string(5) "new d" +string(5) "new e" +string(5) "new f" +object(stdClass)#%d (6) { + ["a"]=> + string(5) "new a" + ["b"]=> + string(5) "new b" + ["c"]=> + string(5) "new c" + ["d"]=> + string(5) "new d" + ["e"]=> + string(5) "new e" + ["f"]=> + string(5) "new f" +} + +Substituting the iterated object for an array. +string(10) "Original a" +string(10) "Original b" +int(1) +int(2) +int(3) +int(4) +int(5) +int(6) +int(7) +int(8) +array(8) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) + [5]=> + int(6) + [6]=> + int(7) + [7]=> + int(8) +} + +Substituting the iterated array for an object. +int(1) +int(2) +string(10) "Original a" +string(10) "Original b" +string(10) "Original c" +string(10) "Original d" +string(10) "Original e" +object(C)#%d (5) { + ["a"]=> + string(10) "Original a" + ["b"]=> + string(10) "Original b" + ["c"]=> + string(10) "Original c" + ["d"]=> + string(10) "Original d" + ["e"]=> + string(10) "Original e" +} diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt new file mode 100644 index 0000000..598b844 --- /dev/null +++ b/tests/lang/foreach_with_object_001.phpt @@ -0,0 +1,25 @@ +--TEST-- +foreach() with foreach($o->mthd()->arr) +--FILE-- +c()->a as $value) { + print "$value\n"; +} + +?> +===DONE=== +--EXPECT-- +1 +2 +3 +4 +5 +===DONE=== diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt new file mode 100644 index 0000000..eb52bb8 --- /dev/null +++ b/tests/lang/foreach_with_references_001.phpt @@ -0,0 +1,32 @@ +--TEST-- +foreach() with references +--FILE-- + "one", 2 => "two", 3 => "three"); + +foreach($arr as $key => $val) { + $val = $key; +} + +print_r($arr); + +foreach($arr as $key => &$val) { + $val = $key; +} + +print_r($arr); + +--EXPECT-- +Array +( + [1] => one + [2] => two + [3] => three +) +Array +( + [1] => 1 + [2] => 2 + [3] => 3 +) diff --git a/tests/lang/func_get_arg.001.phpt b/tests/lang/func_get_arg.001.phpt new file mode 100644 index 0000000..b1bbb18 --- /dev/null +++ b/tests/lang/func_get_arg.001.phpt @@ -0,0 +1,15 @@ +--TEST-- +func_get_arg test +--FILE-- + +--EXPECT-- +2 \ No newline at end of file diff --git a/tests/lang/func_get_arg.002.phpt b/tests/lang/func_get_arg.002.phpt new file mode 100644 index 0000000..6ab4f95 --- /dev/null +++ b/tests/lang/func_get_arg.002.phpt @@ -0,0 +1,19 @@ +--TEST-- +func_get_arg with variable number of args +--FILE-- + +--EXPECT-- +int(3) +int(3) diff --git a/tests/lang/func_get_arg.003.phpt b/tests/lang/func_get_arg.003.phpt new file mode 100644 index 0000000..4ef9967 --- /dev/null +++ b/tests/lang/func_get_arg.003.phpt @@ -0,0 +1,11 @@ +--TEST-- +func_get_arg outside of a function declaration +--FILE-- + +--EXPECTF-- +Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d +bool(false) diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt new file mode 100644 index 0000000..6931df0 --- /dev/null +++ b/tests/lang/func_get_arg.004.phpt @@ -0,0 +1,16 @@ +--TEST-- +func_get_arg on non-existent arg +--FILE-- + +--EXPECTF-- +Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d +bool(false) \ No newline at end of file diff --git a/tests/lang/func_get_arg.005.phpt b/tests/lang/func_get_arg.005.phpt new file mode 100644 index 0000000..e1ae78e --- /dev/null +++ b/tests/lang/func_get_arg.005.phpt @@ -0,0 +1,19 @@ +--TEST-- +A variable, which is referenced by another variable, is passed by value. +During the call, the original variable is updated. This should not affect func_get_arg(). +--FILE-- + +--EXPECTF-- +string(10) "original.a" +string(10) "original.a" \ No newline at end of file diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt new file mode 100644 index 0000000..5dd0ed6 --- /dev/null +++ b/tests/lang/func_get_arg_variation.phpt @@ -0,0 +1,28 @@ +--TEST-- +func_get_arg test +--FILE-- + +--EXPECTF-- +Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d + +Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d + +Warning: func_get_arg() expects parameter 1 to be long, string given in %s on line %d + +Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d + +Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d + diff --git a/tests/lang/func_get_args.001.phpt b/tests/lang/func_get_args.001.phpt new file mode 100644 index 0000000..740a0a2 --- /dev/null +++ b/tests/lang/func_get_args.001.phpt @@ -0,0 +1,15 @@ +--TEST-- +func_get_args with no args +--FILE-- + +--EXPECT-- +array(0) { +} \ No newline at end of file diff --git a/tests/lang/func_get_args.002.phpt b/tests/lang/func_get_args.002.phpt new file mode 100644 index 0000000..0a886c2 --- /dev/null +++ b/tests/lang/func_get_args.002.phpt @@ -0,0 +1,22 @@ +--TEST-- +func_get_args with variable number of args +--FILE-- + +--EXPECT-- +array(3) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) +} + diff --git a/tests/lang/func_get_args.003.phpt b/tests/lang/func_get_args.003.phpt new file mode 100644 index 0000000..44faf7e --- /dev/null +++ b/tests/lang/func_get_args.003.phpt @@ -0,0 +1,11 @@ +--TEST-- +func_get_args() outside of a function declaration +--FILE-- + +--EXPECTREGEX-- +Warning\: func_get_args\(\)\: Called from the global scope - no function context in \S* on line 3 +bool\(false\) diff --git a/tests/lang/func_get_args.004.phpt b/tests/lang/func_get_args.004.phpt new file mode 100644 index 0000000..84e3ebe --- /dev/null +++ b/tests/lang/func_get_args.004.phpt @@ -0,0 +1,67 @@ +--TEST-- +Pass same variable by ref and by value. +--FILE-- + +--EXPECTF-- + +-- Val, Ref -- +string(10) "original.a" +string(10) "original.a" +array(2) { + [0]=> + string(10) "original.a" + [1]=> + string(10) "original.a" +} +array(2) { + [0]=> + string(10) "original.a" + [1]=> + string(9) "changed.y" +} +string(9) "changed.y" + + +-- Ref, Val -- +string(10) "original.b" +string(10) "original.b" +array(2) { + [0]=> + string(10) "original.b" + [1]=> + string(10) "original.b" +} +array(2) { + [0]=> + string(9) "changed.x" + [1]=> + string(10) "original.b" +} +string(9) "changed.x" \ No newline at end of file diff --git a/tests/lang/func_num_args.001.phpt b/tests/lang/func_num_args.001.phpt new file mode 100644 index 0000000..c281557 --- /dev/null +++ b/tests/lang/func_num_args.001.phpt @@ -0,0 +1,14 @@ +--TEST-- +func_num_args with no args +--FILE-- + +--EXPECT-- +int(0) \ No newline at end of file diff --git a/tests/lang/func_num_args.002.phpt b/tests/lang/func_num_args.002.phpt new file mode 100644 index 0000000..bfb8f7c --- /dev/null +++ b/tests/lang/func_num_args.002.phpt @@ -0,0 +1,14 @@ +--TEST-- +func_num_args with variable number of args +--FILE-- + +--EXPECT-- +int(3) \ No newline at end of file diff --git a/tests/lang/func_num_args.003.phpt b/tests/lang/func_num_args.003.phpt new file mode 100644 index 0000000..7cf1229 --- /dev/null +++ b/tests/lang/func_num_args.003.phpt @@ -0,0 +1,12 @@ +--TEST-- +func_num_args() outside of a function declaration +--FILE-- + +--EXPECTF-- + +Warning: func_num_args(): Called from the global scope - no function context in %s on line %d +int(-1) \ No newline at end of file diff --git a/tests/lang/func_num_args.004.phpt b/tests/lang/func_num_args.004.phpt new file mode 100644 index 0000000..8bdc6f0 --- /dev/null +++ b/tests/lang/func_num_args.004.phpt @@ -0,0 +1,48 @@ +--TEST-- +Pass same variable by ref and by value. +--FILE-- + +--EXPECTF-- + + +-- Val, Ref -- +string(10) "original.a" +string(10) "original.a" +int(2) +int(2) +string(9) "changed.y" + + +-- Ref, Val -- +string(10) "original.b" +string(10) "original.b" +int(2) +int(2) +string(9) "changed.x" diff --git a/tests/lang/inc.inc b/tests/lang/inc.inc new file mode 100644 index 0000000..64b30af --- /dev/null +++ b/tests/lang/inc.inc @@ -0,0 +1,3 @@ + diff --git a/tests/lang/inc_throw.inc b/tests/lang/inc_throw.inc new file mode 100644 index 0000000..1f032f7 --- /dev/null +++ b/tests/lang/inc_throw.inc @@ -0,0 +1,5 @@ + diff --git a/tests/lang/include_files/echo.inc b/tests/lang/include_files/echo.inc new file mode 100644 index 0000000..60714f6 --- /dev/null +++ b/tests/lang/include_files/echo.inc @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/tests/lang/include_files/eval.inc b/tests/lang/include_files/eval.inc new file mode 100644 index 0000000..16da862 --- /dev/null +++ b/tests/lang/include_files/eval.inc @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/tests/lang/include_files/function.inc b/tests/lang/include_files/function.inc new file mode 100644 index 0000000..528f46c --- /dev/null +++ b/tests/lang/include_files/function.inc @@ -0,0 +1,3 @@ + diff --git a/tests/lang/include_variation1.phpt b/tests/lang/include_variation1.phpt new file mode 100644 index 0000000..cf99ba9 --- /dev/null +++ b/tests/lang/include_variation1.phpt @@ -0,0 +1,8 @@ +--TEST-- +include() a file from the current script directory +--FILE-- + +--EXPECT-- +Included! diff --git a/tests/lang/include_variation2.phpt b/tests/lang/include_variation2.phpt new file mode 100644 index 0000000..051ed71 --- /dev/null +++ b/tests/lang/include_variation2.phpt @@ -0,0 +1,9 @@ +--TEST-- +Including a file in the current script directory from an included function +--FILE-- + +--EXPECT-- +Included! diff --git a/tests/lang/include_variation3.phpt b/tests/lang/include_variation3.phpt new file mode 100644 index 0000000..1fa80c5 --- /dev/null +++ b/tests/lang/include_variation3.phpt @@ -0,0 +1,8 @@ +--TEST-- +Including a file in the current script directory from eval'd code +--FILE-- + +--EXPECT-- +Included! \ No newline at end of file diff --git a/tests/lang/operators/add_basiclong_64bit.phpt b/tests/lang/operators/add_basiclong_64bit.phpt new file mode 100644 index 0000000..cae8f4f --- /dev/null +++ b/tests/lang/operators/add_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test + operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 + 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 + 1 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 + -1 --- +int(9223372036854775806) +--- testing: 9223372036854775807 + 7 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 + 9 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 + 65 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 + -44 --- +int(9223372036854775763) +--- testing: 9223372036854775807 + 2147483647 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 + 9223372036854775807 --- +float(1.844674407371E+19) +--- testing: -9223372036854775808 + 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 + 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775808 + -1 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 + 7 --- +int(-9223372036854775801) +--- testing: -9223372036854775808 + 9 --- +int(-9223372036854775799) +--- testing: -9223372036854775808 + 65 --- +int(-9223372036854775743) +--- testing: -9223372036854775808 + -44 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 + 2147483647 --- +int(-9223372034707292161) +--- testing: -9223372036854775808 + 9223372036854775807 --- +int(-1) +--- testing: 2147483647 + 0 --- +int(2147483647) +--- testing: 2147483647 + 1 --- +int(2147483648) +--- testing: 2147483647 + -1 --- +int(2147483646) +--- testing: 2147483647 + 7 --- +int(2147483654) +--- testing: 2147483647 + 9 --- +int(2147483656) +--- testing: 2147483647 + 65 --- +int(2147483712) +--- testing: 2147483647 + -44 --- +int(2147483603) +--- testing: 2147483647 + 2147483647 --- +int(4294967294) +--- testing: 2147483647 + 9223372036854775807 --- +float(9.2233720390023E+18) +--- testing: -2147483648 + 0 --- +int(-2147483648) +--- testing: -2147483648 + 1 --- +int(-2147483647) +--- testing: -2147483648 + -1 --- +int(-2147483649) +--- testing: -2147483648 + 7 --- +int(-2147483641) +--- testing: -2147483648 + 9 --- +int(-2147483639) +--- testing: -2147483648 + 65 --- +int(-2147483583) +--- testing: -2147483648 + -44 --- +int(-2147483692) +--- testing: -2147483648 + 2147483647 --- +int(-1) +--- testing: -2147483648 + 9223372036854775807 --- +int(9223372034707292159) +--- testing: 9223372034707292160 + 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 + 1 --- +int(9223372034707292161) +--- testing: 9223372034707292160 + -1 --- +int(9223372034707292159) +--- testing: 9223372034707292160 + 7 --- +int(9223372034707292167) +--- testing: 9223372034707292160 + 9 --- +int(9223372034707292169) +--- testing: 9223372034707292160 + 65 --- +int(9223372034707292225) +--- testing: 9223372034707292160 + -44 --- +int(9223372034707292116) +--- testing: 9223372034707292160 + 2147483647 --- +int(9223372036854775807) +--- testing: 9223372034707292160 + 9223372036854775807 --- +float(1.8446744071562E+19) +--- testing: -9223372034707292160 + 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 + 1 --- +int(-9223372034707292159) +--- testing: -9223372034707292160 + -1 --- +int(-9223372034707292161) +--- testing: -9223372034707292160 + 7 --- +int(-9223372034707292153) +--- testing: -9223372034707292160 + 9 --- +int(-9223372034707292151) +--- testing: -9223372034707292160 + 65 --- +int(-9223372034707292095) +--- testing: -9223372034707292160 + -44 --- +int(-9223372034707292204) +--- testing: -9223372034707292160 + 2147483647 --- +int(-9223372032559808513) +--- testing: -9223372034707292160 + 9223372036854775807 --- +int(2147483647) +--- testing: 2147483648 + 0 --- +int(2147483648) +--- testing: 2147483648 + 1 --- +int(2147483649) +--- testing: 2147483648 + -1 --- +int(2147483647) +--- testing: 2147483648 + 7 --- +int(2147483655) +--- testing: 2147483648 + 9 --- +int(2147483657) +--- testing: 2147483648 + 65 --- +int(2147483713) +--- testing: 2147483648 + -44 --- +int(2147483604) +--- testing: 2147483648 + 2147483647 --- +int(4294967295) +--- testing: 2147483648 + 9223372036854775807 --- +float(9.2233720390023E+18) +--- testing: -2147483649 + 0 --- +int(-2147483649) +--- testing: -2147483649 + 1 --- +int(-2147483648) +--- testing: -2147483649 + -1 --- +int(-2147483650) +--- testing: -2147483649 + 7 --- +int(-2147483642) +--- testing: -2147483649 + 9 --- +int(-2147483640) +--- testing: -2147483649 + 65 --- +int(-2147483584) +--- testing: -2147483649 + -44 --- +int(-2147483693) +--- testing: -2147483649 + 2147483647 --- +int(-2) +--- testing: -2147483649 + 9223372036854775807 --- +int(9223372034707292158) +--- testing: 4294967294 + 0 --- +int(4294967294) +--- testing: 4294967294 + 1 --- +int(4294967295) +--- testing: 4294967294 + -1 --- +int(4294967293) +--- testing: 4294967294 + 7 --- +int(4294967301) +--- testing: 4294967294 + 9 --- +int(4294967303) +--- testing: 4294967294 + 65 --- +int(4294967359) +--- testing: 4294967294 + -44 --- +int(4294967250) +--- testing: 4294967294 + 2147483647 --- +int(6442450941) +--- testing: 4294967294 + 9223372036854775807 --- +float(9.2233720411497E+18) +--- testing: 4294967295 + 0 --- +int(4294967295) +--- testing: 4294967295 + 1 --- +int(4294967296) +--- testing: 4294967295 + -1 --- +int(4294967294) +--- testing: 4294967295 + 7 --- +int(4294967302) +--- testing: 4294967295 + 9 --- +int(4294967304) +--- testing: 4294967295 + 65 --- +int(4294967360) +--- testing: 4294967295 + -44 --- +int(4294967251) +--- testing: 4294967295 + 2147483647 --- +int(6442450942) +--- testing: 4294967295 + 9223372036854775807 --- +float(9.2233720411497E+18) +--- testing: 4294967293 + 0 --- +int(4294967293) +--- testing: 4294967293 + 1 --- +int(4294967294) +--- testing: 4294967293 + -1 --- +int(4294967292) +--- testing: 4294967293 + 7 --- +int(4294967300) +--- testing: 4294967293 + 9 --- +int(4294967302) +--- testing: 4294967293 + 65 --- +int(4294967358) +--- testing: 4294967293 + -44 --- +int(4294967249) +--- testing: 4294967293 + 2147483647 --- +int(6442450940) +--- testing: 4294967293 + 9223372036854775807 --- +float(9.2233720411497E+18) +--- testing: 9223372036854775806 + 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 + 1 --- +int(9223372036854775807) +--- testing: 9223372036854775806 + -1 --- +int(9223372036854775805) +--- testing: 9223372036854775806 + 7 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775806 + 9 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775806 + 65 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775806 + -44 --- +int(9223372036854775762) +--- testing: 9223372036854775806 + 2147483647 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775806 + 9223372036854775807 --- +float(1.844674407371E+19) +--- testing: 9.2233720368548E+18 + 0 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + 1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + -1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + 7 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + 9 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + 65 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + -44 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 + 2147483647 --- +float(9.2233720390023E+18) +--- testing: 9.2233720368548E+18 + 9223372036854775807 --- +float(1.844674407371E+19) +--- testing: -9223372036854775807 + 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 + 1 --- +int(-9223372036854775806) +--- testing: -9223372036854775807 + -1 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 + 7 --- +int(-9223372036854775800) +--- testing: -9223372036854775807 + 9 --- +int(-9223372036854775798) +--- testing: -9223372036854775807 + 65 --- +int(-9223372036854775742) +--- testing: -9223372036854775807 + -44 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775807 + 2147483647 --- +int(-9223372034707292160) +--- testing: -9223372036854775807 + 9223372036854775807 --- +int(0) +--- testing: -9.2233720368548E+18 + 0 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + 1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + -1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + 7 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + 9 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + 65 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + -44 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 + 2147483647 --- +float(-9.2233720347073E+18) +--- testing: -9.2233720368548E+18 + 9223372036854775807 --- +float(0) +--- testing: 0 + 9223372036854775807 --- +int(9223372036854775807) +--- testing: 0 + -9223372036854775808 --- +int(-9223372036854775808) +--- testing: 0 + 2147483647 --- +int(2147483647) +--- testing: 0 + -2147483648 --- +int(-2147483648) +--- testing: 0 + 9223372034707292160 --- +int(9223372034707292160) +--- testing: 0 + -9223372034707292160 --- +int(-9223372034707292160) +--- testing: 0 + 2147483648 --- +int(2147483648) +--- testing: 0 + -2147483649 --- +int(-2147483649) +--- testing: 0 + 4294967294 --- +int(4294967294) +--- testing: 0 + 4294967295 --- +int(4294967295) +--- testing: 0 + 4294967293 --- +int(4294967293) +--- testing: 0 + 9223372036854775806 --- +int(9223372036854775806) +--- testing: 0 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 0 + -9223372036854775807 --- +int(-9223372036854775807) +--- testing: 0 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 1 + 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 1 + -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 1 + 2147483647 --- +int(2147483648) +--- testing: 1 + -2147483648 --- +int(-2147483647) +--- testing: 1 + 9223372034707292160 --- +int(9223372034707292161) +--- testing: 1 + -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 1 + 2147483648 --- +int(2147483649) +--- testing: 1 + -2147483649 --- +int(-2147483648) +--- testing: 1 + 4294967294 --- +int(4294967295) +--- testing: 1 + 4294967295 --- +int(4294967296) +--- testing: 1 + 4294967293 --- +int(4294967294) +--- testing: 1 + 9223372036854775806 --- +int(9223372036854775807) +--- testing: 1 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 1 + -9223372036854775807 --- +int(-9223372036854775806) +--- testing: 1 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -1 + 9223372036854775807 --- +int(9223372036854775806) +--- testing: -1 + -9223372036854775808 --- +float(-9.2233720368548E+18) +--- testing: -1 + 2147483647 --- +int(2147483646) +--- testing: -1 + -2147483648 --- +int(-2147483649) +--- testing: -1 + 9223372034707292160 --- +int(9223372034707292159) +--- testing: -1 + -9223372034707292160 --- +int(-9223372034707292161) +--- testing: -1 + 2147483648 --- +int(2147483647) +--- testing: -1 + -2147483649 --- +int(-2147483650) +--- testing: -1 + 4294967294 --- +int(4294967293) +--- testing: -1 + 4294967295 --- +int(4294967294) +--- testing: -1 + 4294967293 --- +int(4294967292) +--- testing: -1 + 9223372036854775806 --- +int(9223372036854775805) +--- testing: -1 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -1 + -9223372036854775807 --- +int(-9223372036854775808) +--- testing: -1 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 7 + 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 7 + -9223372036854775808 --- +int(-9223372036854775801) +--- testing: 7 + 2147483647 --- +int(2147483654) +--- testing: 7 + -2147483648 --- +int(-2147483641) +--- testing: 7 + 9223372034707292160 --- +int(9223372034707292167) +--- testing: 7 + -9223372034707292160 --- +int(-9223372034707292153) +--- testing: 7 + 2147483648 --- +int(2147483655) +--- testing: 7 + -2147483649 --- +int(-2147483642) +--- testing: 7 + 4294967294 --- +int(4294967301) +--- testing: 7 + 4294967295 --- +int(4294967302) +--- testing: 7 + 4294967293 --- +int(4294967300) +--- testing: 7 + 9223372036854775806 --- +float(9.2233720368548E+18) +--- testing: 7 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 7 + -9223372036854775807 --- +int(-9223372036854775800) +--- testing: 7 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 9 + 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 9 + -9223372036854775808 --- +int(-9223372036854775799) +--- testing: 9 + 2147483647 --- +int(2147483656) +--- testing: 9 + -2147483648 --- +int(-2147483639) +--- testing: 9 + 9223372034707292160 --- +int(9223372034707292169) +--- testing: 9 + -9223372034707292160 --- +int(-9223372034707292151) +--- testing: 9 + 2147483648 --- +int(2147483657) +--- testing: 9 + -2147483649 --- +int(-2147483640) +--- testing: 9 + 4294967294 --- +int(4294967303) +--- testing: 9 + 4294967295 --- +int(4294967304) +--- testing: 9 + 4294967293 --- +int(4294967302) +--- testing: 9 + 9223372036854775806 --- +float(9.2233720368548E+18) +--- testing: 9 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 9 + -9223372036854775807 --- +int(-9223372036854775798) +--- testing: 9 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 65 + 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 65 + -9223372036854775808 --- +int(-9223372036854775743) +--- testing: 65 + 2147483647 --- +int(2147483712) +--- testing: 65 + -2147483648 --- +int(-2147483583) +--- testing: 65 + 9223372034707292160 --- +int(9223372034707292225) +--- testing: 65 + -9223372034707292160 --- +int(-9223372034707292095) +--- testing: 65 + 2147483648 --- +int(2147483713) +--- testing: 65 + -2147483649 --- +int(-2147483584) +--- testing: 65 + 4294967294 --- +int(4294967359) +--- testing: 65 + 4294967295 --- +int(4294967360) +--- testing: 65 + 4294967293 --- +int(4294967358) +--- testing: 65 + 9223372036854775806 --- +float(9.2233720368548E+18) +--- testing: 65 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 65 + -9223372036854775807 --- +int(-9223372036854775742) +--- testing: 65 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -44 + 9223372036854775807 --- +int(9223372036854775763) +--- testing: -44 + -9223372036854775808 --- +float(-9.2233720368548E+18) +--- testing: -44 + 2147483647 --- +int(2147483603) +--- testing: -44 + -2147483648 --- +int(-2147483692) +--- testing: -44 + 9223372034707292160 --- +int(9223372034707292116) +--- testing: -44 + -9223372034707292160 --- +int(-9223372034707292204) +--- testing: -44 + 2147483648 --- +int(2147483604) +--- testing: -44 + -2147483649 --- +int(-2147483693) +--- testing: -44 + 4294967294 --- +int(4294967250) +--- testing: -44 + 4294967295 --- +int(4294967251) +--- testing: -44 + 4294967293 --- +int(4294967249) +--- testing: -44 + 9223372036854775806 --- +int(9223372036854775762) +--- testing: -44 + 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -44 + -9223372036854775807 --- +float(-9.2233720368548E+18) +--- testing: -44 + -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 2147483647 + 9223372036854775807 --- +float(9.2233720390023E+18) +--- testing: 2147483647 + -9223372036854775808 --- +int(-9223372034707292161) +--- testing: 2147483647 + 2147483647 --- +int(4294967294) +--- testing: 2147483647 + -2147483648 --- +int(-1) +--- testing: 2147483647 + 9223372034707292160 --- +int(9223372036854775807) +--- testing: 2147483647 + -9223372034707292160 --- +int(-9223372032559808513) +--- testing: 2147483647 + 2147483648 --- +int(4294967295) +--- testing: 2147483647 + -2147483649 --- +int(-2) +--- testing: 2147483647 + 4294967294 --- +int(6442450941) +--- testing: 2147483647 + 4294967295 --- +int(6442450942) +--- testing: 2147483647 + 4294967293 --- +int(6442450940) +--- testing: 2147483647 + 9223372036854775806 --- +float(9.2233720390023E+18) +--- testing: 2147483647 + 9.2233720368548E+18 --- +float(9.2233720390023E+18) +--- testing: 2147483647 + -9223372036854775807 --- +int(-9223372034707292160) +--- testing: 2147483647 + -9.2233720368548E+18 --- +float(-9.2233720347073E+18) +--- testing: 9223372036854775807 + 9223372036854775807 --- +float(1.844674407371E+19) +--- testing: 9223372036854775807 + -9223372036854775808 --- +int(-1) +--- testing: 9223372036854775807 + 2147483647 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 + -2147483648 --- +int(9223372034707292159) +--- testing: 9223372036854775807 + 9223372034707292160 --- +float(1.8446744071562E+19) +--- testing: 9223372036854775807 + -9223372034707292160 --- +int(2147483647) +--- testing: 9223372036854775807 + 2147483648 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 + -2147483649 --- +int(9223372034707292158) +--- testing: 9223372036854775807 + 4294967294 --- +float(9.2233720411497E+18) +--- testing: 9223372036854775807 + 4294967295 --- +float(9.2233720411497E+18) +--- testing: 9223372036854775807 + 4294967293 --- +float(9.2233720411497E+18) +--- testing: 9223372036854775807 + 9223372036854775806 --- +float(1.844674407371E+19) +--- testing: 9223372036854775807 + 9.2233720368548E+18 --- +float(1.844674407371E+19) +--- testing: 9223372036854775807 + -9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 + -9.2233720368548E+18 --- +float(0) +===DONE=== diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt new file mode 100644 index 0000000..264c5c1 --- /dev/null +++ b/tests/lang/operators/add_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test + operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' + '0' --- +int(0) +--- testing: '0' + '65' --- +int(65) +--- testing: '0' + '-44' --- +int(-44) +--- testing: '0' + '1.2' --- +float(1.2) +--- testing: '0' + '-7.7' --- +float(-7.7) +--- testing: '0' + 'abc' --- +int(0) +--- testing: '0' + '123abc' --- +int(123) +--- testing: '0' + '123e5' --- +float(12300000) +--- testing: '0' + '123e5xyz' --- +float(12300000) +--- testing: '0' + ' 123abc' --- +int(123) +--- testing: '0' + '123 abc' --- +int(123) +--- testing: '0' + '123abc ' --- +int(123) +--- testing: '0' + '3.4a' --- +float(3.4) +--- testing: '0' + 'a5.9' --- +int(0) +--- testing: '65' + '0' --- +int(65) +--- testing: '65' + '65' --- +int(130) +--- testing: '65' + '-44' --- +int(21) +--- testing: '65' + '1.2' --- +float(66.2) +--- testing: '65' + '-7.7' --- +float(57.3) +--- testing: '65' + 'abc' --- +int(65) +--- testing: '65' + '123abc' --- +int(188) +--- testing: '65' + '123e5' --- +float(12300065) +--- testing: '65' + '123e5xyz' --- +float(12300065) +--- testing: '65' + ' 123abc' --- +int(188) +--- testing: '65' + '123 abc' --- +int(188) +--- testing: '65' + '123abc ' --- +int(188) +--- testing: '65' + '3.4a' --- +float(68.4) +--- testing: '65' + 'a5.9' --- +int(65) +--- testing: '-44' + '0' --- +int(-44) +--- testing: '-44' + '65' --- +int(21) +--- testing: '-44' + '-44' --- +int(-88) +--- testing: '-44' + '1.2' --- +float(-42.8) +--- testing: '-44' + '-7.7' --- +float(-51.7) +--- testing: '-44' + 'abc' --- +int(-44) +--- testing: '-44' + '123abc' --- +int(79) +--- testing: '-44' + '123e5' --- +float(12299956) +--- testing: '-44' + '123e5xyz' --- +float(12299956) +--- testing: '-44' + ' 123abc' --- +int(79) +--- testing: '-44' + '123 abc' --- +int(79) +--- testing: '-44' + '123abc ' --- +int(79) +--- testing: '-44' + '3.4a' --- +float(-40.6) +--- testing: '-44' + 'a5.9' --- +int(-44) +--- testing: '1.2' + '0' --- +float(1.2) +--- testing: '1.2' + '65' --- +float(66.2) +--- testing: '1.2' + '-44' --- +float(-42.8) +--- testing: '1.2' + '1.2' --- +float(2.4) +--- testing: '1.2' + '-7.7' --- +float(-6.5) +--- testing: '1.2' + 'abc' --- +float(1.2) +--- testing: '1.2' + '123abc' --- +float(124.2) +--- testing: '1.2' + '123e5' --- +float(12300001.2) +--- testing: '1.2' + '123e5xyz' --- +float(12300001.2) +--- testing: '1.2' + ' 123abc' --- +float(124.2) +--- testing: '1.2' + '123 abc' --- +float(124.2) +--- testing: '1.2' + '123abc ' --- +float(124.2) +--- testing: '1.2' + '3.4a' --- +float(4.6) +--- testing: '1.2' + 'a5.9' --- +float(1.2) +--- testing: '-7.7' + '0' --- +float(-7.7) +--- testing: '-7.7' + '65' --- +float(57.3) +--- testing: '-7.7' + '-44' --- +float(-51.7) +--- testing: '-7.7' + '1.2' --- +float(-6.5) +--- testing: '-7.7' + '-7.7' --- +float(-15.4) +--- testing: '-7.7' + 'abc' --- +float(-7.7) +--- testing: '-7.7' + '123abc' --- +float(115.3) +--- testing: '-7.7' + '123e5' --- +float(12299992.3) +--- testing: '-7.7' + '123e5xyz' --- +float(12299992.3) +--- testing: '-7.7' + ' 123abc' --- +float(115.3) +--- testing: '-7.7' + '123 abc' --- +float(115.3) +--- testing: '-7.7' + '123abc ' --- +float(115.3) +--- testing: '-7.7' + '3.4a' --- +float(-4.3) +--- testing: '-7.7' + 'a5.9' --- +float(-7.7) +--- testing: 'abc' + '0' --- +int(0) +--- testing: 'abc' + '65' --- +int(65) +--- testing: 'abc' + '-44' --- +int(-44) +--- testing: 'abc' + '1.2' --- +float(1.2) +--- testing: 'abc' + '-7.7' --- +float(-7.7) +--- testing: 'abc' + 'abc' --- +int(0) +--- testing: 'abc' + '123abc' --- +int(123) +--- testing: 'abc' + '123e5' --- +float(12300000) +--- testing: 'abc' + '123e5xyz' --- +float(12300000) +--- testing: 'abc' + ' 123abc' --- +int(123) +--- testing: 'abc' + '123 abc' --- +int(123) +--- testing: 'abc' + '123abc ' --- +int(123) +--- testing: 'abc' + '3.4a' --- +float(3.4) +--- testing: 'abc' + 'a5.9' --- +int(0) +--- testing: '123abc' + '0' --- +int(123) +--- testing: '123abc' + '65' --- +int(188) +--- testing: '123abc' + '-44' --- +int(79) +--- testing: '123abc' + '1.2' --- +float(124.2) +--- testing: '123abc' + '-7.7' --- +float(115.3) +--- testing: '123abc' + 'abc' --- +int(123) +--- testing: '123abc' + '123abc' --- +int(246) +--- testing: '123abc' + '123e5' --- +float(12300123) +--- testing: '123abc' + '123e5xyz' --- +float(12300123) +--- testing: '123abc' + ' 123abc' --- +int(246) +--- testing: '123abc' + '123 abc' --- +int(246) +--- testing: '123abc' + '123abc ' --- +int(246) +--- testing: '123abc' + '3.4a' --- +float(126.4) +--- testing: '123abc' + 'a5.9' --- +int(123) +--- testing: '123e5' + '0' --- +float(12300000) +--- testing: '123e5' + '65' --- +float(12300065) +--- testing: '123e5' + '-44' --- +float(12299956) +--- testing: '123e5' + '1.2' --- +float(12300001.2) +--- testing: '123e5' + '-7.7' --- +float(12299992.3) +--- testing: '123e5' + 'abc' --- +float(12300000) +--- testing: '123e5' + '123abc' --- +float(12300123) +--- testing: '123e5' + '123e5' --- +float(24600000) +--- testing: '123e5' + '123e5xyz' --- +float(24600000) +--- testing: '123e5' + ' 123abc' --- +float(12300123) +--- testing: '123e5' + '123 abc' --- +float(12300123) +--- testing: '123e5' + '123abc ' --- +float(12300123) +--- testing: '123e5' + '3.4a' --- +float(12300003.4) +--- testing: '123e5' + 'a5.9' --- +float(12300000) +--- testing: '123e5xyz' + '0' --- +float(12300000) +--- testing: '123e5xyz' + '65' --- +float(12300065) +--- testing: '123e5xyz' + '-44' --- +float(12299956) +--- testing: '123e5xyz' + '1.2' --- +float(12300001.2) +--- testing: '123e5xyz' + '-7.7' --- +float(12299992.3) +--- testing: '123e5xyz' + 'abc' --- +float(12300000) +--- testing: '123e5xyz' + '123abc' --- +float(12300123) +--- testing: '123e5xyz' + '123e5' --- +float(24600000) +--- testing: '123e5xyz' + '123e5xyz' --- +float(24600000) +--- testing: '123e5xyz' + ' 123abc' --- +float(12300123) +--- testing: '123e5xyz' + '123 abc' --- +float(12300123) +--- testing: '123e5xyz' + '123abc ' --- +float(12300123) +--- testing: '123e5xyz' + '3.4a' --- +float(12300003.4) +--- testing: '123e5xyz' + 'a5.9' --- +float(12300000) +--- testing: ' 123abc' + '0' --- +int(123) +--- testing: ' 123abc' + '65' --- +int(188) +--- testing: ' 123abc' + '-44' --- +int(79) +--- testing: ' 123abc' + '1.2' --- +float(124.2) +--- testing: ' 123abc' + '-7.7' --- +float(115.3) +--- testing: ' 123abc' + 'abc' --- +int(123) +--- testing: ' 123abc' + '123abc' --- +int(246) +--- testing: ' 123abc' + '123e5' --- +float(12300123) +--- testing: ' 123abc' + '123e5xyz' --- +float(12300123) +--- testing: ' 123abc' + ' 123abc' --- +int(246) +--- testing: ' 123abc' + '123 abc' --- +int(246) +--- testing: ' 123abc' + '123abc ' --- +int(246) +--- testing: ' 123abc' + '3.4a' --- +float(126.4) +--- testing: ' 123abc' + 'a5.9' --- +int(123) +--- testing: '123 abc' + '0' --- +int(123) +--- testing: '123 abc' + '65' --- +int(188) +--- testing: '123 abc' + '-44' --- +int(79) +--- testing: '123 abc' + '1.2' --- +float(124.2) +--- testing: '123 abc' + '-7.7' --- +float(115.3) +--- testing: '123 abc' + 'abc' --- +int(123) +--- testing: '123 abc' + '123abc' --- +int(246) +--- testing: '123 abc' + '123e5' --- +float(12300123) +--- testing: '123 abc' + '123e5xyz' --- +float(12300123) +--- testing: '123 abc' + ' 123abc' --- +int(246) +--- testing: '123 abc' + '123 abc' --- +int(246) +--- testing: '123 abc' + '123abc ' --- +int(246) +--- testing: '123 abc' + '3.4a' --- +float(126.4) +--- testing: '123 abc' + 'a5.9' --- +int(123) +--- testing: '123abc ' + '0' --- +int(123) +--- testing: '123abc ' + '65' --- +int(188) +--- testing: '123abc ' + '-44' --- +int(79) +--- testing: '123abc ' + '1.2' --- +float(124.2) +--- testing: '123abc ' + '-7.7' --- +float(115.3) +--- testing: '123abc ' + 'abc' --- +int(123) +--- testing: '123abc ' + '123abc' --- +int(246) +--- testing: '123abc ' + '123e5' --- +float(12300123) +--- testing: '123abc ' + '123e5xyz' --- +float(12300123) +--- testing: '123abc ' + ' 123abc' --- +int(246) +--- testing: '123abc ' + '123 abc' --- +int(246) +--- testing: '123abc ' + '123abc ' --- +int(246) +--- testing: '123abc ' + '3.4a' --- +float(126.4) +--- testing: '123abc ' + 'a5.9' --- +int(123) +--- testing: '3.4a' + '0' --- +float(3.4) +--- testing: '3.4a' + '65' --- +float(68.4) +--- testing: '3.4a' + '-44' --- +float(-40.6) +--- testing: '3.4a' + '1.2' --- +float(4.6) +--- testing: '3.4a' + '-7.7' --- +float(-4.3) +--- testing: '3.4a' + 'abc' --- +float(3.4) +--- testing: '3.4a' + '123abc' --- +float(126.4) +--- testing: '3.4a' + '123e5' --- +float(12300003.4) +--- testing: '3.4a' + '123e5xyz' --- +float(12300003.4) +--- testing: '3.4a' + ' 123abc' --- +float(126.4) +--- testing: '3.4a' + '123 abc' --- +float(126.4) +--- testing: '3.4a' + '123abc ' --- +float(126.4) +--- testing: '3.4a' + '3.4a' --- +float(6.8) +--- testing: '3.4a' + 'a5.9' --- +float(3.4) +--- testing: 'a5.9' + '0' --- +int(0) +--- testing: 'a5.9' + '65' --- +int(65) +--- testing: 'a5.9' + '-44' --- +int(-44) +--- testing: 'a5.9' + '1.2' --- +float(1.2) +--- testing: 'a5.9' + '-7.7' --- +float(-7.7) +--- testing: 'a5.9' + 'abc' --- +int(0) +--- testing: 'a5.9' + '123abc' --- +int(123) +--- testing: 'a5.9' + '123e5' --- +float(12300000) +--- testing: 'a5.9' + '123e5xyz' --- +float(12300000) +--- testing: 'a5.9' + ' 123abc' --- +int(123) +--- testing: 'a5.9' + '123 abc' --- +int(123) +--- testing: 'a5.9' + '123abc ' --- +int(123) +--- testing: 'a5.9' + '3.4a' --- +float(3.4) +--- testing: 'a5.9' + 'a5.9' --- +int(0) +===DONE=== diff --git a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt new file mode 100644 index 0000000..f463e5d --- /dev/null +++ b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test & operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 & 0 --- +int(0) +--- testing: 9223372036854775807 & 1 --- +int(1) +--- testing: 9223372036854775807 & -1 --- +int(9223372036854775807) +--- testing: 9223372036854775807 & 7 --- +int(7) +--- testing: 9223372036854775807 & 9 --- +int(9) +--- testing: 9223372036854775807 & 65 --- +int(65) +--- testing: 9223372036854775807 & -44 --- +int(9223372036854775764) +--- testing: 9223372036854775807 & 2147483647 --- +int(2147483647) +--- testing: 9223372036854775807 & 9223372036854775807 --- +int(9223372036854775807) +--- testing: -9223372036854775808 & 0 --- +int(0) +--- testing: -9223372036854775808 & 1 --- +int(0) +--- testing: -9223372036854775808 & -1 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 & 7 --- +int(0) +--- testing: -9223372036854775808 & 9 --- +int(0) +--- testing: -9223372036854775808 & 65 --- +int(0) +--- testing: -9223372036854775808 & -44 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 & 2147483647 --- +int(0) +--- testing: -9223372036854775808 & 9223372036854775807 --- +int(0) +--- testing: 2147483647 & 0 --- +int(0) +--- testing: 2147483647 & 1 --- +int(1) +--- testing: 2147483647 & -1 --- +int(2147483647) +--- testing: 2147483647 & 7 --- +int(7) +--- testing: 2147483647 & 9 --- +int(9) +--- testing: 2147483647 & 65 --- +int(65) +--- testing: 2147483647 & -44 --- +int(2147483604) +--- testing: 2147483647 & 2147483647 --- +int(2147483647) +--- testing: 2147483647 & 9223372036854775807 --- +int(2147483647) +--- testing: -2147483648 & 0 --- +int(0) +--- testing: -2147483648 & 1 --- +int(0) +--- testing: -2147483648 & -1 --- +int(-2147483648) +--- testing: -2147483648 & 7 --- +int(0) +--- testing: -2147483648 & 9 --- +int(0) +--- testing: -2147483648 & 65 --- +int(0) +--- testing: -2147483648 & -44 --- +int(-2147483648) +--- testing: -2147483648 & 2147483647 --- +int(0) +--- testing: -2147483648 & 9223372036854775807 --- +int(9223372034707292160) +--- testing: 9223372034707292160 & 0 --- +int(0) +--- testing: 9223372034707292160 & 1 --- +int(0) +--- testing: 9223372034707292160 & -1 --- +int(9223372034707292160) +--- testing: 9223372034707292160 & 7 --- +int(0) +--- testing: 9223372034707292160 & 9 --- +int(0) +--- testing: 9223372034707292160 & 65 --- +int(0) +--- testing: 9223372034707292160 & -44 --- +int(9223372034707292160) +--- testing: 9223372034707292160 & 2147483647 --- +int(0) +--- testing: 9223372034707292160 & 9223372036854775807 --- +int(9223372034707292160) +--- testing: -9223372034707292160 & 0 --- +int(0) +--- testing: -9223372034707292160 & 1 --- +int(0) +--- testing: -9223372034707292160 & -1 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 & 7 --- +int(0) +--- testing: -9223372034707292160 & 9 --- +int(0) +--- testing: -9223372034707292160 & 65 --- +int(0) +--- testing: -9223372034707292160 & -44 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 & 2147483647 --- +int(0) +--- testing: -9223372034707292160 & 9223372036854775807 --- +int(2147483648) +--- testing: 2147483648 & 0 --- +int(0) +--- testing: 2147483648 & 1 --- +int(0) +--- testing: 2147483648 & -1 --- +int(2147483648) +--- testing: 2147483648 & 7 --- +int(0) +--- testing: 2147483648 & 9 --- +int(0) +--- testing: 2147483648 & 65 --- +int(0) +--- testing: 2147483648 & -44 --- +int(2147483648) +--- testing: 2147483648 & 2147483647 --- +int(0) +--- testing: 2147483648 & 9223372036854775807 --- +int(2147483648) +--- testing: -2147483649 & 0 --- +int(0) +--- testing: -2147483649 & 1 --- +int(1) +--- testing: -2147483649 & -1 --- +int(-2147483649) +--- testing: -2147483649 & 7 --- +int(7) +--- testing: -2147483649 & 9 --- +int(9) +--- testing: -2147483649 & 65 --- +int(65) +--- testing: -2147483649 & -44 --- +int(-2147483692) +--- testing: -2147483649 & 2147483647 --- +int(2147483647) +--- testing: -2147483649 & 9223372036854775807 --- +int(9223372034707292159) +--- testing: 4294967294 & 0 --- +int(0) +--- testing: 4294967294 & 1 --- +int(0) +--- testing: 4294967294 & -1 --- +int(4294967294) +--- testing: 4294967294 & 7 --- +int(6) +--- testing: 4294967294 & 9 --- +int(8) +--- testing: 4294967294 & 65 --- +int(64) +--- testing: 4294967294 & -44 --- +int(4294967252) +--- testing: 4294967294 & 2147483647 --- +int(2147483646) +--- testing: 4294967294 & 9223372036854775807 --- +int(4294967294) +--- testing: 4294967295 & 0 --- +int(0) +--- testing: 4294967295 & 1 --- +int(1) +--- testing: 4294967295 & -1 --- +int(4294967295) +--- testing: 4294967295 & 7 --- +int(7) +--- testing: 4294967295 & 9 --- +int(9) +--- testing: 4294967295 & 65 --- +int(65) +--- testing: 4294967295 & -44 --- +int(4294967252) +--- testing: 4294967295 & 2147483647 --- +int(2147483647) +--- testing: 4294967295 & 9223372036854775807 --- +int(4294967295) +--- testing: 4294967293 & 0 --- +int(0) +--- testing: 4294967293 & 1 --- +int(1) +--- testing: 4294967293 & -1 --- +int(4294967293) +--- testing: 4294967293 & 7 --- +int(5) +--- testing: 4294967293 & 9 --- +int(9) +--- testing: 4294967293 & 65 --- +int(65) +--- testing: 4294967293 & -44 --- +int(4294967252) +--- testing: 4294967293 & 2147483647 --- +int(2147483645) +--- testing: 4294967293 & 9223372036854775807 --- +int(4294967293) +--- testing: 9223372036854775806 & 0 --- +int(0) +--- testing: 9223372036854775806 & 1 --- +int(0) +--- testing: 9223372036854775806 & -1 --- +int(9223372036854775806) +--- testing: 9223372036854775806 & 7 --- +int(6) +--- testing: 9223372036854775806 & 9 --- +int(8) +--- testing: 9223372036854775806 & 65 --- +int(64) +--- testing: 9223372036854775806 & -44 --- +int(9223372036854775764) +--- testing: 9223372036854775806 & 2147483647 --- +int(2147483646) +--- testing: 9223372036854775806 & 9223372036854775807 --- +int(9223372036854775806) +--- testing: 9.2233720368548E+18 & 0 --- +int(0) +--- testing: 9.2233720368548E+18 & 1 --- +int(0) +--- testing: 9.2233720368548E+18 & -1 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 & 7 --- +int(0) +--- testing: 9.2233720368548E+18 & 9 --- +int(0) +--- testing: 9.2233720368548E+18 & 65 --- +int(0) +--- testing: 9.2233720368548E+18 & -44 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 & 2147483647 --- +int(0) +--- testing: 9.2233720368548E+18 & 9223372036854775807 --- +int(0) +--- testing: -9223372036854775807 & 0 --- +int(0) +--- testing: -9223372036854775807 & 1 --- +int(1) +--- testing: -9223372036854775807 & -1 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 & 7 --- +int(1) +--- testing: -9223372036854775807 & 9 --- +int(1) +--- testing: -9223372036854775807 & 65 --- +int(1) +--- testing: -9223372036854775807 & -44 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 & 2147483647 --- +int(1) +--- testing: -9223372036854775807 & 9223372036854775807 --- +int(1) +--- testing: -9.2233720368548E+18 & 0 --- +int(0) +--- testing: -9.2233720368548E+18 & 1 --- +int(0) +--- testing: -9.2233720368548E+18 & -1 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 & 7 --- +int(0) +--- testing: -9.2233720368548E+18 & 9 --- +int(0) +--- testing: -9.2233720368548E+18 & 65 --- +int(0) +--- testing: -9.2233720368548E+18 & -44 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 & 2147483647 --- +int(0) +--- testing: -9.2233720368548E+18 & 9223372036854775807 --- +int(0) +--- testing: 0 & 9223372036854775807 --- +int(0) +--- testing: 0 & -9223372036854775808 --- +int(0) +--- testing: 0 & 2147483647 --- +int(0) +--- testing: 0 & -2147483648 --- +int(0) +--- testing: 0 & 9223372034707292160 --- +int(0) +--- testing: 0 & -9223372034707292160 --- +int(0) +--- testing: 0 & 2147483648 --- +int(0) +--- testing: 0 & -2147483649 --- +int(0) +--- testing: 0 & 4294967294 --- +int(0) +--- testing: 0 & 4294967295 --- +int(0) +--- testing: 0 & 4294967293 --- +int(0) +--- testing: 0 & 9223372036854775806 --- +int(0) +--- testing: 0 & 9.2233720368548E+18 --- +int(0) +--- testing: 0 & -9223372036854775807 --- +int(0) +--- testing: 0 & -9.2233720368548E+18 --- +int(0) +--- testing: 1 & 9223372036854775807 --- +int(1) +--- testing: 1 & -9223372036854775808 --- +int(0) +--- testing: 1 & 2147483647 --- +int(1) +--- testing: 1 & -2147483648 --- +int(0) +--- testing: 1 & 9223372034707292160 --- +int(0) +--- testing: 1 & -9223372034707292160 --- +int(0) +--- testing: 1 & 2147483648 --- +int(0) +--- testing: 1 & -2147483649 --- +int(1) +--- testing: 1 & 4294967294 --- +int(0) +--- testing: 1 & 4294967295 --- +int(1) +--- testing: 1 & 4294967293 --- +int(1) +--- testing: 1 & 9223372036854775806 --- +int(0) +--- testing: 1 & 9.2233720368548E+18 --- +int(0) +--- testing: 1 & -9223372036854775807 --- +int(1) +--- testing: 1 & -9.2233720368548E+18 --- +int(0) +--- testing: -1 & 9223372036854775807 --- +int(9223372036854775807) +--- testing: -1 & -9223372036854775808 --- +int(-9223372036854775808) +--- testing: -1 & 2147483647 --- +int(2147483647) +--- testing: -1 & -2147483648 --- +int(-2147483648) +--- testing: -1 & 9223372034707292160 --- +int(9223372034707292160) +--- testing: -1 & -9223372034707292160 --- +int(-9223372034707292160) +--- testing: -1 & 2147483648 --- +int(2147483648) +--- testing: -1 & -2147483649 --- +int(-2147483649) +--- testing: -1 & 4294967294 --- +int(4294967294) +--- testing: -1 & 4294967295 --- +int(4294967295) +--- testing: -1 & 4294967293 --- +int(4294967293) +--- testing: -1 & 9223372036854775806 --- +int(9223372036854775806) +--- testing: -1 & 9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: -1 & -9223372036854775807 --- +int(-9223372036854775807) +--- testing: -1 & -9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 7 & 9223372036854775807 --- +int(7) +--- testing: 7 & -9223372036854775808 --- +int(0) +--- testing: 7 & 2147483647 --- +int(7) +--- testing: 7 & -2147483648 --- +int(0) +--- testing: 7 & 9223372034707292160 --- +int(0) +--- testing: 7 & -9223372034707292160 --- +int(0) +--- testing: 7 & 2147483648 --- +int(0) +--- testing: 7 & -2147483649 --- +int(7) +--- testing: 7 & 4294967294 --- +int(6) +--- testing: 7 & 4294967295 --- +int(7) +--- testing: 7 & 4294967293 --- +int(5) +--- testing: 7 & 9223372036854775806 --- +int(6) +--- testing: 7 & 9.2233720368548E+18 --- +int(0) +--- testing: 7 & -9223372036854775807 --- +int(1) +--- testing: 7 & -9.2233720368548E+18 --- +int(0) +--- testing: 9 & 9223372036854775807 --- +int(9) +--- testing: 9 & -9223372036854775808 --- +int(0) +--- testing: 9 & 2147483647 --- +int(9) +--- testing: 9 & -2147483648 --- +int(0) +--- testing: 9 & 9223372034707292160 --- +int(0) +--- testing: 9 & -9223372034707292160 --- +int(0) +--- testing: 9 & 2147483648 --- +int(0) +--- testing: 9 & -2147483649 --- +int(9) +--- testing: 9 & 4294967294 --- +int(8) +--- testing: 9 & 4294967295 --- +int(9) +--- testing: 9 & 4294967293 --- +int(9) +--- testing: 9 & 9223372036854775806 --- +int(8) +--- testing: 9 & 9.2233720368548E+18 --- +int(0) +--- testing: 9 & -9223372036854775807 --- +int(1) +--- testing: 9 & -9.2233720368548E+18 --- +int(0) +--- testing: 65 & 9223372036854775807 --- +int(65) +--- testing: 65 & -9223372036854775808 --- +int(0) +--- testing: 65 & 2147483647 --- +int(65) +--- testing: 65 & -2147483648 --- +int(0) +--- testing: 65 & 9223372034707292160 --- +int(0) +--- testing: 65 & -9223372034707292160 --- +int(0) +--- testing: 65 & 2147483648 --- +int(0) +--- testing: 65 & -2147483649 --- +int(65) +--- testing: 65 & 4294967294 --- +int(64) +--- testing: 65 & 4294967295 --- +int(65) +--- testing: 65 & 4294967293 --- +int(65) +--- testing: 65 & 9223372036854775806 --- +int(64) +--- testing: 65 & 9.2233720368548E+18 --- +int(0) +--- testing: 65 & -9223372036854775807 --- +int(1) +--- testing: 65 & -9.2233720368548E+18 --- +int(0) +--- testing: -44 & 9223372036854775807 --- +int(9223372036854775764) +--- testing: -44 & -9223372036854775808 --- +int(-9223372036854775808) +--- testing: -44 & 2147483647 --- +int(2147483604) +--- testing: -44 & -2147483648 --- +int(-2147483648) +--- testing: -44 & 9223372034707292160 --- +int(9223372034707292160) +--- testing: -44 & -9223372034707292160 --- +int(-9223372034707292160) +--- testing: -44 & 2147483648 --- +int(2147483648) +--- testing: -44 & -2147483649 --- +int(-2147483692) +--- testing: -44 & 4294967294 --- +int(4294967252) +--- testing: -44 & 4294967295 --- +int(4294967252) +--- testing: -44 & 4294967293 --- +int(4294967252) +--- testing: -44 & 9223372036854775806 --- +int(9223372036854775764) +--- testing: -44 & 9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: -44 & -9223372036854775807 --- +int(-9223372036854775808) +--- testing: -44 & -9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 2147483647 & 9223372036854775807 --- +int(2147483647) +--- testing: 2147483647 & -9223372036854775808 --- +int(0) +--- testing: 2147483647 & 2147483647 --- +int(2147483647) +--- testing: 2147483647 & -2147483648 --- +int(0) +--- testing: 2147483647 & 9223372034707292160 --- +int(0) +--- testing: 2147483647 & -9223372034707292160 --- +int(0) +--- testing: 2147483647 & 2147483648 --- +int(0) +--- testing: 2147483647 & -2147483649 --- +int(2147483647) +--- testing: 2147483647 & 4294967294 --- +int(2147483646) +--- testing: 2147483647 & 4294967295 --- +int(2147483647) +--- testing: 2147483647 & 4294967293 --- +int(2147483645) +--- testing: 2147483647 & 9223372036854775806 --- +int(2147483646) +--- testing: 2147483647 & 9.2233720368548E+18 --- +int(0) +--- testing: 2147483647 & -9223372036854775807 --- +int(1) +--- testing: 2147483647 & -9.2233720368548E+18 --- +int(0) +--- testing: 9223372036854775807 & 9223372036854775807 --- +int(9223372036854775807) +--- testing: 9223372036854775807 & -9223372036854775808 --- +int(0) +--- testing: 9223372036854775807 & 2147483647 --- +int(2147483647) +--- testing: 9223372036854775807 & -2147483648 --- +int(9223372034707292160) +--- testing: 9223372036854775807 & 9223372034707292160 --- +int(9223372034707292160) +--- testing: 9223372036854775807 & -9223372034707292160 --- +int(2147483648) +--- testing: 9223372036854775807 & 2147483648 --- +int(2147483648) +--- testing: 9223372036854775807 & -2147483649 --- +int(9223372034707292159) +--- testing: 9223372036854775807 & 4294967294 --- +int(4294967294) +--- testing: 9223372036854775807 & 4294967295 --- +int(4294967295) +--- testing: 9223372036854775807 & 4294967293 --- +int(4294967293) +--- testing: 9223372036854775807 & 9223372036854775806 --- +int(9223372036854775806) +--- testing: 9223372036854775807 & 9.2233720368548E+18 --- +int(0) +--- testing: 9223372036854775807 & -9223372036854775807 --- +int(1) +--- testing: 9223372036854775807 & -9.2233720368548E+18 --- +int(0) +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/bitwiseAnd_variationStr.phpt b/tests/lang/operators/bitwiseAnd_variationStr.phpt new file mode 100644 index 0000000..2602270 --- /dev/null +++ b/tests/lang/operators/bitwiseAnd_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test & operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' & '0' --- +string(2) "30" +--- testing: '0' & '65' --- +string(2) "30" +--- testing: '0' & '-44' --- +string(2) "20" +--- testing: '0' & '1.2' --- +string(2) "30" +--- testing: '0' & '-7.7' --- +string(2) "20" +--- testing: '0' & 'abc' --- +string(2) "20" +--- testing: '0' & '123abc' --- +string(2) "30" +--- testing: '0' & '123e5' --- +string(2) "30" +--- testing: '0' & '123e5xyz' --- +string(2) "30" +--- testing: '0' & ' 123abc' --- +string(2) "20" +--- testing: '0' & '123 abc' --- +string(2) "30" +--- testing: '0' & '123abc ' --- +string(2) "30" +--- testing: '0' & '3.4a' --- +string(2) "30" +--- testing: '0' & 'a5.9' --- +string(2) "20" +--- testing: '65' & '0' --- +string(2) "30" +--- testing: '65' & '65' --- +string(4) "3635" +--- testing: '65' & '-44' --- +string(4) "2434" +--- testing: '65' & '1.2' --- +string(4) "3024" +--- testing: '65' & '-7.7' --- +string(4) "2435" +--- testing: '65' & 'abc' --- +string(4) "2020" +--- testing: '65' & '123abc' --- +string(4) "3030" +--- testing: '65' & '123e5' --- +string(4) "3030" +--- testing: '65' & '123e5xyz' --- +string(4) "3030" +--- testing: '65' & ' 123abc' --- +string(4) "2031" +--- testing: '65' & '123 abc' --- +string(4) "3030" +--- testing: '65' & '123abc ' --- +string(4) "3030" +--- testing: '65' & '3.4a' --- +string(4) "3224" +--- testing: '65' & 'a5.9' --- +string(4) "2035" +--- testing: '-44' & '0' --- +string(2) "20" +--- testing: '-44' & '65' --- +string(4) "2434" +--- testing: '-44' & '-44' --- +string(6) "2d3434" +--- testing: '-44' & '1.2' --- +string(6) "212430" +--- testing: '-44' & '-7.7' --- +string(6) "2d3424" +--- testing: '-44' & 'abc' --- +string(6) "212020" +--- testing: '-44' & '123abc' --- +string(6) "213030" +--- testing: '-44' & '123e5' --- +string(6) "213030" +--- testing: '-44' & '123e5xyz' --- +string(6) "213030" +--- testing: '-44' & ' 123abc' --- +string(6) "203030" +--- testing: '-44' & '123 abc' --- +string(6) "213030" +--- testing: '-44' & '123abc ' --- +string(6) "213030" +--- testing: '-44' & '3.4a' --- +string(6) "212434" +--- testing: '-44' & 'a5.9' --- +string(6) "213424" +--- testing: '1.2' & '0' --- +string(2) "30" +--- testing: '1.2' & '65' --- +string(4) "3024" +--- testing: '1.2' & '-44' --- +string(6) "212430" +--- testing: '1.2' & '1.2' --- +string(6) "312e32" +--- testing: '1.2' & '-7.7' --- +string(6) "212622" +--- testing: '1.2' & 'abc' --- +string(6) "212222" +--- testing: '1.2' & '123abc' --- +string(6) "312232" +--- testing: '1.2' & '123e5' --- +string(6) "312232" +--- testing: '1.2' & '123e5xyz' --- +string(6) "312232" +--- testing: '1.2' & ' 123abc' --- +string(6) "202032" +--- testing: '1.2' & '123 abc' --- +string(6) "312232" +--- testing: '1.2' & '123abc ' --- +string(6) "312232" +--- testing: '1.2' & '3.4a' --- +string(6) "312e30" +--- testing: '1.2' & 'a5.9' --- +string(6) "212422" +--- testing: '-7.7' & '0' --- +string(2) "20" +--- testing: '-7.7' & '65' --- +string(4) "2435" +--- testing: '-7.7' & '-44' --- +string(6) "2d3424" +--- testing: '-7.7' & '1.2' --- +string(6) "212622" +--- testing: '-7.7' & '-7.7' --- +string(8) "2d372e37" +--- testing: '-7.7' & 'abc' --- +string(6) "212222" +--- testing: '-7.7' & '123abc' --- +string(8) "21322221" +--- testing: '-7.7' & '123e5' --- +string(8) "21322225" +--- testing: '-7.7' & '123e5xyz' --- +string(8) "21322225" +--- testing: '-7.7' & ' 123abc' --- +string(8) "20312233" +--- testing: '-7.7' & '123 abc' --- +string(8) "21322220" +--- testing: '-7.7' & '123abc ' --- +string(8) "21322221" +--- testing: '-7.7' & '3.4a' --- +string(8) "21262421" +--- testing: '-7.7' & 'a5.9' --- +string(8) "21352e31" +--- testing: 'abc' & '0' --- +string(2) "20" +--- testing: 'abc' & '65' --- +string(4) "2020" +--- testing: 'abc' & '-44' --- +string(6) "212020" +--- testing: 'abc' & '1.2' --- +string(6) "212222" +--- testing: 'abc' & '-7.7' --- +string(6) "212222" +--- testing: 'abc' & 'abc' --- +string(6) "616263" +--- testing: 'abc' & '123abc' --- +string(6) "212223" +--- testing: 'abc' & '123e5' --- +string(6) "212223" +--- testing: 'abc' & '123e5xyz' --- +string(6) "212223" +--- testing: 'abc' & ' 123abc' --- +string(6) "202022" +--- testing: 'abc' & '123 abc' --- +string(6) "212223" +--- testing: 'abc' & '123abc ' --- +string(6) "212223" +--- testing: 'abc' & '3.4a' --- +string(6) "212220" +--- testing: 'abc' & 'a5.9' --- +string(6) "612022" +--- testing: '123abc' & '0' --- +string(2) "30" +--- testing: '123abc' & '65' --- +string(4) "3030" +--- testing: '123abc' & '-44' --- +string(6) "213030" +--- testing: '123abc' & '1.2' --- +string(6) "312232" +--- testing: '123abc' & '-7.7' --- +string(8) "21322221" +--- testing: '123abc' & 'abc' --- +string(6) "212223" +--- testing: '123abc' & '123abc' --- +string(12) "313233616263" +--- testing: '123abc' & '123e5' --- +string(10) "3132336120" +--- testing: '123abc' & '123e5xyz' --- +string(12) "313233612060" +--- testing: '123abc' & ' 123abc' --- +string(12) "203032216062" +--- testing: '123abc' & '123 abc' --- +string(12) "313233206062" +--- testing: '123abc' & '123abc ' --- +string(12) "313233616263" +--- testing: '123abc' & '3.4a' --- +string(8) "31223061" +--- testing: '123abc' & 'a5.9' --- +string(8) "21302221" +--- testing: '123e5' & '0' --- +string(2) "30" +--- testing: '123e5' & '65' --- +string(4) "3030" +--- testing: '123e5' & '-44' --- +string(6) "213030" +--- testing: '123e5' & '1.2' --- +string(6) "312232" +--- testing: '123e5' & '-7.7' --- +string(8) "21322225" +--- testing: '123e5' & 'abc' --- +string(6) "212223" +--- testing: '123e5' & '123abc' --- +string(10) "3132336120" +--- testing: '123e5' & '123e5' --- +string(10) "3132336535" +--- testing: '123e5' & '123e5xyz' --- +string(10) "3132336535" +--- testing: '123e5' & ' 123abc' --- +string(10) "2030322121" +--- testing: '123e5' & '123 abc' --- +string(10) "3132332021" +--- testing: '123e5' & '123abc ' --- +string(10) "3132336120" +--- testing: '123e5' & '3.4a' --- +string(8) "31223061" +--- testing: '123e5' & 'a5.9' --- +string(8) "21302221" +--- testing: '123e5xyz' & '0' --- +string(2) "30" +--- testing: '123e5xyz' & '65' --- +string(4) "3030" +--- testing: '123e5xyz' & '-44' --- +string(6) "213030" +--- testing: '123e5xyz' & '1.2' --- +string(6) "312232" +--- testing: '123e5xyz' & '-7.7' --- +string(8) "21322225" +--- testing: '123e5xyz' & 'abc' --- +string(6) "212223" +--- testing: '123e5xyz' & '123abc' --- +string(12) "313233612060" +--- testing: '123e5xyz' & '123e5' --- +string(10) "3132336535" +--- testing: '123e5xyz' & '123e5xyz' --- +string(16) "313233653578797a" +--- testing: '123e5xyz' & ' 123abc' --- +string(14) "20303221216061" +--- testing: '123e5xyz' & '123 abc' --- +string(14) "31323320216061" +--- testing: '123e5xyz' & '123abc ' --- +string(14) "31323361206020" +--- testing: '123e5xyz' & '3.4a' --- +string(8) "31223061" +--- testing: '123e5xyz' & 'a5.9' --- +string(8) "21302221" +--- testing: ' 123abc' & '0' --- +string(2) "20" +--- testing: ' 123abc' & '65' --- +string(4) "2031" +--- testing: ' 123abc' & '-44' --- +string(6) "203030" +--- testing: ' 123abc' & '1.2' --- +string(6) "202032" +--- testing: ' 123abc' & '-7.7' --- +string(8) "20312233" +--- testing: ' 123abc' & 'abc' --- +string(6) "202022" +--- testing: ' 123abc' & '123abc' --- +string(12) "203032216062" +--- testing: ' 123abc' & '123e5' --- +string(10) "2030322121" +--- testing: ' 123abc' & '123e5xyz' --- +string(14) "20303221216061" +--- testing: ' 123abc' & ' 123abc' --- +string(14) "20313233616263" +--- testing: ' 123abc' & '123 abc' --- +string(14) "20303220616263" +--- testing: ' 123abc' & '123abc ' --- +string(14) "20303221606220" +--- testing: ' 123abc' & '3.4a' --- +string(8) "20203021" +--- testing: ' 123abc' & 'a5.9' --- +string(8) "20312231" +--- testing: '123 abc' & '0' --- +string(2) "30" +--- testing: '123 abc' & '65' --- +string(4) "3030" +--- testing: '123 abc' & '-44' --- +string(6) "213030" +--- testing: '123 abc' & '1.2' --- +string(6) "312232" +--- testing: '123 abc' & '-7.7' --- +string(8) "21322220" +--- testing: '123 abc' & 'abc' --- +string(6) "212223" +--- testing: '123 abc' & '123abc' --- +string(12) "313233206062" +--- testing: '123 abc' & '123e5' --- +string(10) "3132332021" +--- testing: '123 abc' & '123e5xyz' --- +string(14) "31323320216061" +--- testing: '123 abc' & ' 123abc' --- +string(14) "20303220616263" +--- testing: '123 abc' & '123 abc' --- +string(14) "31323320616263" +--- testing: '123 abc' & '123abc ' --- +string(14) "31323320606220" +--- testing: '123 abc' & '3.4a' --- +string(8) "31223020" +--- testing: '123 abc' & 'a5.9' --- +string(8) "21302220" +--- testing: '123abc ' & '0' --- +string(2) "30" +--- testing: '123abc ' & '65' --- +string(4) "3030" +--- testing: '123abc ' & '-44' --- +string(6) "213030" +--- testing: '123abc ' & '1.2' --- +string(6) "312232" +--- testing: '123abc ' & '-7.7' --- +string(8) "21322221" +--- testing: '123abc ' & 'abc' --- +string(6) "212223" +--- testing: '123abc ' & '123abc' --- +string(12) "313233616263" +--- testing: '123abc ' & '123e5' --- +string(10) "3132336120" +--- testing: '123abc ' & '123e5xyz' --- +string(14) "31323361206020" +--- testing: '123abc ' & ' 123abc' --- +string(14) "20303221606220" +--- testing: '123abc ' & '123 abc' --- +string(14) "31323320606220" +--- testing: '123abc ' & '123abc ' --- +string(14) "31323361626320" +--- testing: '123abc ' & '3.4a' --- +string(8) "31223061" +--- testing: '123abc ' & 'a5.9' --- +string(8) "21302221" +--- testing: '3.4a' & '0' --- +string(2) "30" +--- testing: '3.4a' & '65' --- +string(4) "3224" +--- testing: '3.4a' & '-44' --- +string(6) "212434" +--- testing: '3.4a' & '1.2' --- +string(6) "312e30" +--- testing: '3.4a' & '-7.7' --- +string(8) "21262421" +--- testing: '3.4a' & 'abc' --- +string(6) "212220" +--- testing: '3.4a' & '123abc' --- +string(8) "31223061" +--- testing: '3.4a' & '123e5' --- +string(8) "31223061" +--- testing: '3.4a' & '123e5xyz' --- +string(8) "31223061" +--- testing: '3.4a' & ' 123abc' --- +string(8) "20203021" +--- testing: '3.4a' & '123 abc' --- +string(8) "31223020" +--- testing: '3.4a' & '123abc ' --- +string(8) "31223061" +--- testing: '3.4a' & '3.4a' --- +string(8) "332e3461" +--- testing: '3.4a' & 'a5.9' --- +string(8) "21242421" +--- testing: 'a5.9' & '0' --- +string(2) "20" +--- testing: 'a5.9' & '65' --- +string(4) "2035" +--- testing: 'a5.9' & '-44' --- +string(6) "213424" +--- testing: 'a5.9' & '1.2' --- +string(6) "212422" +--- testing: 'a5.9' & '-7.7' --- +string(8) "21352e31" +--- testing: 'a5.9' & 'abc' --- +string(6) "612022" +--- testing: 'a5.9' & '123abc' --- +string(8) "21302221" +--- testing: 'a5.9' & '123e5' --- +string(8) "21302221" +--- testing: 'a5.9' & '123e5xyz' --- +string(8) "21302221" +--- testing: 'a5.9' & ' 123abc' --- +string(8) "20312231" +--- testing: 'a5.9' & '123 abc' --- +string(8) "21302220" +--- testing: 'a5.9' & '123abc ' --- +string(8) "21302221" +--- testing: 'a5.9' & '3.4a' --- +string(8) "21242421" +--- testing: 'a5.9' & 'a5.9' --- +string(8) "61352e39" +===DONE=== diff --git a/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt new file mode 100644 index 0000000..227b734 --- /dev/null +++ b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test ~N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 --- +int(9223372036854775807) +--- testing: 2147483647 --- +int(-2147483648) +--- testing: -2147483648 --- +int(2147483647) +--- testing: 9223372034707292160 --- +int(-9223372034707292161) +--- testing: -9223372034707292160 --- +int(9223372034707292159) +--- testing: 2147483648 --- +int(-2147483649) +--- testing: -2147483649 --- +int(2147483648) +--- testing: 4294967294 --- +int(-4294967295) +--- testing: 4294967295 --- +int(-4294967296) +--- testing: 4294967293 --- +int(-4294967294) +--- testing: 9223372036854775806 --- +int(-9223372036854775807) +--- testing: 9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: -9223372036854775807 --- +int(9223372036854775806) +--- testing: -9.2233720368548E+18 --- +int(9223372036854775807) +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/bitwiseNot_variationStr.phpt b/tests/lang/operators/bitwiseNot_variationStr.phpt new file mode 100644 index 0000000..3e7b698 --- /dev/null +++ b/tests/lang/operators/bitwiseNot_variationStr.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test ~N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +string(2) "cf" +--- testing: '65' --- +string(4) "c9ca" +--- testing: '-44' --- +string(6) "d2cbcb" +--- testing: '1.2' --- +string(6) "ced1cd" +--- testing: '-7.7' --- +string(8) "d2c8d1c8" +--- testing: 'abc' --- +string(6) "9e9d9c" +--- testing: '123abc' --- +string(12) "cecdcc9e9d9c" +--- testing: '123e5' --- +string(10) "cecdcc9aca" +--- testing: '123e5xyz' --- +string(16) "cecdcc9aca878685" +--- testing: ' 123abc' --- +string(14) "dfcecdcc9e9d9c" +--- testing: '123 abc' --- +string(14) "cecdccdf9e9d9c" +--- testing: '123abc ' --- +string(14) "cecdcc9e9d9cdf" +--- testing: '3.4a' --- +string(8) "ccd1cb9e" +--- testing: 'a5.9' --- +string(8) "9ecad1c6" +===DONE=== diff --git a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt new file mode 100644 index 0000000..e26d46a --- /dev/null +++ b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt @@ -0,0 +1,583 @@ +--TEST-- +Test | operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 | 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 1 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -1 --- +int(-1) +--- testing: 9223372036854775807 | 7 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 9 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 65 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -44 --- +int(-1) +--- testing: 9223372036854775807 | 2147483647 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: -9223372036854775808 | 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 | 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775808 | -1 --- +int(-1) +--- testing: -9223372036854775808 | 7 --- +int(-9223372036854775801) +--- testing: -9223372036854775808 | 9 --- +int(-9223372036854775799) +--- testing: -9223372036854775808 | 65 --- +int(-9223372036854775743) +--- testing: -9223372036854775808 | -44 --- +int(-44) +--- testing: -9223372036854775808 | 2147483647 --- +int(-9223372034707292161) +--- testing: -9223372036854775808 | 9223372036854775807 --- +int(-1) +--- testing: 2147483647 | 0 --- +int(2147483647) +--- testing: 2147483647 | 1 --- +int(2147483647) +--- testing: 2147483647 | -1 --- +int(-1) +--- testing: 2147483647 | 7 --- +int(2147483647) +--- testing: 2147483647 | 9 --- +int(2147483647) +--- testing: 2147483647 | 65 --- +int(2147483647) +--- testing: 2147483647 | -44 --- +int(-1) +--- testing: 2147483647 | 2147483647 --- +int(2147483647) +--- testing: 2147483647 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: -2147483648 | 0 --- +int(-2147483648) +--- testing: -2147483648 | 1 --- +int(-2147483647) +--- testing: -2147483648 | -1 --- +int(-1) +--- testing: -2147483648 | 7 --- +int(-2147483641) +--- testing: -2147483648 | 9 --- +int(-2147483639) +--- testing: -2147483648 | 65 --- +int(-2147483583) +--- testing: -2147483648 | -44 --- +int(-44) +--- testing: -2147483648 | 2147483647 --- +int(-1) +--- testing: -2147483648 | 9223372036854775807 --- +int(-1) +--- testing: 9223372034707292160 | 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 | 1 --- +int(9223372034707292161) +--- testing: 9223372034707292160 | -1 --- +int(-1) +--- testing: 9223372034707292160 | 7 --- +int(9223372034707292167) +--- testing: 9223372034707292160 | 9 --- +int(9223372034707292169) +--- testing: 9223372034707292160 | 65 --- +int(9223372034707292225) +--- testing: 9223372034707292160 | -44 --- +int(-44) +--- testing: 9223372034707292160 | 2147483647 --- +int(9223372036854775807) +--- testing: 9223372034707292160 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: -9223372034707292160 | 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 | 1 --- +int(-9223372034707292159) +--- testing: -9223372034707292160 | -1 --- +int(-1) +--- testing: -9223372034707292160 | 7 --- +int(-9223372034707292153) +--- testing: -9223372034707292160 | 9 --- +int(-9223372034707292151) +--- testing: -9223372034707292160 | 65 --- +int(-9223372034707292095) +--- testing: -9223372034707292160 | -44 --- +int(-44) +--- testing: -9223372034707292160 | 2147483647 --- +int(-9223372032559808513) +--- testing: -9223372034707292160 | 9223372036854775807 --- +int(-1) +--- testing: 2147483648 | 0 --- +int(2147483648) +--- testing: 2147483648 | 1 --- +int(2147483649) +--- testing: 2147483648 | -1 --- +int(-1) +--- testing: 2147483648 | 7 --- +int(2147483655) +--- testing: 2147483648 | 9 --- +int(2147483657) +--- testing: 2147483648 | 65 --- +int(2147483713) +--- testing: 2147483648 | -44 --- +int(-44) +--- testing: 2147483648 | 2147483647 --- +int(4294967295) +--- testing: 2147483648 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: -2147483649 | 0 --- +int(-2147483649) +--- testing: -2147483649 | 1 --- +int(-2147483649) +--- testing: -2147483649 | -1 --- +int(-1) +--- testing: -2147483649 | 7 --- +int(-2147483649) +--- testing: -2147483649 | 9 --- +int(-2147483649) +--- testing: -2147483649 | 65 --- +int(-2147483649) +--- testing: -2147483649 | -44 --- +int(-1) +--- testing: -2147483649 | 2147483647 --- +int(-2147483649) +--- testing: -2147483649 | 9223372036854775807 --- +int(-1) +--- testing: 4294967294 | 0 --- +int(4294967294) +--- testing: 4294967294 | 1 --- +int(4294967295) +--- testing: 4294967294 | -1 --- +int(-1) +--- testing: 4294967294 | 7 --- +int(4294967295) +--- testing: 4294967294 | 9 --- +int(4294967295) +--- testing: 4294967294 | 65 --- +int(4294967295) +--- testing: 4294967294 | -44 --- +int(-2) +--- testing: 4294967294 | 2147483647 --- +int(4294967295) +--- testing: 4294967294 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 4294967295 | 0 --- +int(4294967295) +--- testing: 4294967295 | 1 --- +int(4294967295) +--- testing: 4294967295 | -1 --- +int(-1) +--- testing: 4294967295 | 7 --- +int(4294967295) +--- testing: 4294967295 | 9 --- +int(4294967295) +--- testing: 4294967295 | 65 --- +int(4294967295) +--- testing: 4294967295 | -44 --- +int(-1) +--- testing: 4294967295 | 2147483647 --- +int(4294967295) +--- testing: 4294967295 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 4294967293 | 0 --- +int(4294967293) +--- testing: 4294967293 | 1 --- +int(4294967293) +--- testing: 4294967293 | -1 --- +int(-1) +--- testing: 4294967293 | 7 --- +int(4294967295) +--- testing: 4294967293 | 9 --- +int(4294967293) +--- testing: 4294967293 | 65 --- +int(4294967293) +--- testing: 4294967293 | -44 --- +int(-3) +--- testing: 4294967293 | 2147483647 --- +int(4294967295) +--- testing: 4294967293 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 | 1 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | -1 --- +int(-1) +--- testing: 9223372036854775806 | 7 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | 9 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | 65 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | -44 --- +int(-2) +--- testing: 9223372036854775806 | 2147483647 --- +int(9223372036854775807) +--- testing: 9223372036854775806 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 9.2233720368548E+18 | 0 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 | 1 --- +int(-9223372036854775807) +--- testing: 9.2233720368548E+18 | -1 --- +int(-1) +--- testing: 9.2233720368548E+18 | 7 --- +int(-9223372036854775801) +--- testing: 9.2233720368548E+18 | 9 --- +int(-9223372036854775799) +--- testing: 9.2233720368548E+18 | 65 --- +int(-9223372036854775743) +--- testing: 9.2233720368548E+18 | -44 --- +int(-44) +--- testing: 9.2233720368548E+18 | 2147483647 --- +int(-9223372034707292161) +--- testing: 9.2233720368548E+18 | 9223372036854775807 --- +int(-1) +--- testing: -9223372036854775807 | 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 | 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 | -1 --- +int(-1) +--- testing: -9223372036854775807 | 7 --- +int(-9223372036854775801) +--- testing: -9223372036854775807 | 9 --- +int(-9223372036854775799) +--- testing: -9223372036854775807 | 65 --- +int(-9223372036854775743) +--- testing: -9223372036854775807 | -44 --- +int(-43) +--- testing: -9223372036854775807 | 2147483647 --- +int(-9223372034707292161) +--- testing: -9223372036854775807 | 9223372036854775807 --- +int(-1) +--- testing: -9.2233720368548E+18 | 0 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 | 1 --- +int(-9223372036854775807) +--- testing: -9.2233720368548E+18 | -1 --- +int(-1) +--- testing: -9.2233720368548E+18 | 7 --- +int(-9223372036854775801) +--- testing: -9.2233720368548E+18 | 9 --- +int(-9223372036854775799) +--- testing: -9.2233720368548E+18 | 65 --- +int(-9223372036854775743) +--- testing: -9.2233720368548E+18 | -44 --- +int(-44) +--- testing: -9.2233720368548E+18 | 2147483647 --- +int(-9223372034707292161) +--- testing: -9.2233720368548E+18 | 9223372036854775807 --- +int(-1) +--- testing: 0 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 0 | -9223372036854775808 --- +int(-9223372036854775808) +--- testing: 0 | 2147483647 --- +int(2147483647) +--- testing: 0 | -2147483648 --- +int(-2147483648) +--- testing: 0 | 9223372034707292160 --- +int(9223372034707292160) +--- testing: 0 | -9223372034707292160 --- +int(-9223372034707292160) +--- testing: 0 | 2147483648 --- +int(2147483648) +--- testing: 0 | -2147483649 --- +int(-2147483649) +--- testing: 0 | 4294967294 --- +int(4294967294) +--- testing: 0 | 4294967295 --- +int(4294967295) +--- testing: 0 | 4294967293 --- +int(4294967293) +--- testing: 0 | 9223372036854775806 --- +int(9223372036854775806) +--- testing: 0 | 9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 0 | -9223372036854775807 --- +int(-9223372036854775807) +--- testing: 0 | -9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 1 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 1 | -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 1 | 2147483647 --- +int(2147483647) +--- testing: 1 | -2147483648 --- +int(-2147483647) +--- testing: 1 | 9223372034707292160 --- +int(9223372034707292161) +--- testing: 1 | -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 1 | 2147483648 --- +int(2147483649) +--- testing: 1 | -2147483649 --- +int(-2147483649) +--- testing: 1 | 4294967294 --- +int(4294967295) +--- testing: 1 | 4294967295 --- +int(4294967295) +--- testing: 1 | 4294967293 --- +int(4294967293) +--- testing: 1 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 1 | 9.2233720368548E+18 --- +int(-9223372036854775807) +--- testing: 1 | -9223372036854775807 --- +int(-9223372036854775807) +--- testing: 1 | -9.2233720368548E+18 --- +int(-9223372036854775807) +--- testing: -1 | 9223372036854775807 --- +int(-1) +--- testing: -1 | -9223372036854775808 --- +int(-1) +--- testing: -1 | 2147483647 --- +int(-1) +--- testing: -1 | -2147483648 --- +int(-1) +--- testing: -1 | 9223372034707292160 --- +int(-1) +--- testing: -1 | -9223372034707292160 --- +int(-1) +--- testing: -1 | 2147483648 --- +int(-1) +--- testing: -1 | -2147483649 --- +int(-1) +--- testing: -1 | 4294967294 --- +int(-1) +--- testing: -1 | 4294967295 --- +int(-1) +--- testing: -1 | 4294967293 --- +int(-1) +--- testing: -1 | 9223372036854775806 --- +int(-1) +--- testing: -1 | 9.2233720368548E+18 --- +int(-1) +--- testing: -1 | -9223372036854775807 --- +int(-1) +--- testing: -1 | -9.2233720368548E+18 --- +int(-1) +--- testing: 7 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 7 | -9223372036854775808 --- +int(-9223372036854775801) +--- testing: 7 | 2147483647 --- +int(2147483647) +--- testing: 7 | -2147483648 --- +int(-2147483641) +--- testing: 7 | 9223372034707292160 --- +int(9223372034707292167) +--- testing: 7 | -9223372034707292160 --- +int(-9223372034707292153) +--- testing: 7 | 2147483648 --- +int(2147483655) +--- testing: 7 | -2147483649 --- +int(-2147483649) +--- testing: 7 | 4294967294 --- +int(4294967295) +--- testing: 7 | 4294967295 --- +int(4294967295) +--- testing: 7 | 4294967293 --- +int(4294967295) +--- testing: 7 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 7 | 9.2233720368548E+18 --- +int(-9223372036854775801) +--- testing: 7 | -9223372036854775807 --- +int(-9223372036854775801) +--- testing: 7 | -9.2233720368548E+18 --- +int(-9223372036854775801) +--- testing: 9 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 9 | -9223372036854775808 --- +int(-9223372036854775799) +--- testing: 9 | 2147483647 --- +int(2147483647) +--- testing: 9 | -2147483648 --- +int(-2147483639) +--- testing: 9 | 9223372034707292160 --- +int(9223372034707292169) +--- testing: 9 | -9223372034707292160 --- +int(-9223372034707292151) +--- testing: 9 | 2147483648 --- +int(2147483657) +--- testing: 9 | -2147483649 --- +int(-2147483649) +--- testing: 9 | 4294967294 --- +int(4294967295) +--- testing: 9 | 4294967295 --- +int(4294967295) +--- testing: 9 | 4294967293 --- +int(4294967293) +--- testing: 9 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 9 | 9.2233720368548E+18 --- +int(-9223372036854775799) +--- testing: 9 | -9223372036854775807 --- +int(-9223372036854775799) +--- testing: 9 | -9.2233720368548E+18 --- +int(-9223372036854775799) +--- testing: 65 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 65 | -9223372036854775808 --- +int(-9223372036854775743) +--- testing: 65 | 2147483647 --- +int(2147483647) +--- testing: 65 | -2147483648 --- +int(-2147483583) +--- testing: 65 | 9223372034707292160 --- +int(9223372034707292225) +--- testing: 65 | -9223372034707292160 --- +int(-9223372034707292095) +--- testing: 65 | 2147483648 --- +int(2147483713) +--- testing: 65 | -2147483649 --- +int(-2147483649) +--- testing: 65 | 4294967294 --- +int(4294967295) +--- testing: 65 | 4294967295 --- +int(4294967295) +--- testing: 65 | 4294967293 --- +int(4294967293) +--- testing: 65 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 65 | 9.2233720368548E+18 --- +int(-9223372036854775743) +--- testing: 65 | -9223372036854775807 --- +int(-9223372036854775743) +--- testing: 65 | -9.2233720368548E+18 --- +int(-9223372036854775743) +--- testing: -44 | 9223372036854775807 --- +int(-1) +--- testing: -44 | -9223372036854775808 --- +int(-44) +--- testing: -44 | 2147483647 --- +int(-1) +--- testing: -44 | -2147483648 --- +int(-44) +--- testing: -44 | 9223372034707292160 --- +int(-44) +--- testing: -44 | -9223372034707292160 --- +int(-44) +--- testing: -44 | 2147483648 --- +int(-44) +--- testing: -44 | -2147483649 --- +int(-1) +--- testing: -44 | 4294967294 --- +int(-2) +--- testing: -44 | 4294967295 --- +int(-1) +--- testing: -44 | 4294967293 --- +int(-3) +--- testing: -44 | 9223372036854775806 --- +int(-2) +--- testing: -44 | 9.2233720368548E+18 --- +int(-44) +--- testing: -44 | -9223372036854775807 --- +int(-43) +--- testing: -44 | -9.2233720368548E+18 --- +int(-44) +--- testing: 2147483647 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 2147483647 | -9223372036854775808 --- +int(-9223372034707292161) +--- testing: 2147483647 | 2147483647 --- +int(2147483647) +--- testing: 2147483647 | -2147483648 --- +int(-1) +--- testing: 2147483647 | 9223372034707292160 --- +int(9223372036854775807) +--- testing: 2147483647 | -9223372034707292160 --- +int(-9223372032559808513) +--- testing: 2147483647 | 2147483648 --- +int(4294967295) +--- testing: 2147483647 | -2147483649 --- +int(-2147483649) +--- testing: 2147483647 | 4294967294 --- +int(4294967295) +--- testing: 2147483647 | 4294967295 --- +int(4294967295) +--- testing: 2147483647 | 4294967293 --- +int(4294967295) +--- testing: 2147483647 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 2147483647 | 9.2233720368548E+18 --- +int(-9223372034707292161) +--- testing: 2147483647 | -9223372036854775807 --- +int(-9223372034707292161) +--- testing: 2147483647 | -9.2233720368548E+18 --- +int(-9223372034707292161) +--- testing: 9223372036854775807 | 9223372036854775807 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -9223372036854775808 --- +int(-1) +--- testing: 9223372036854775807 | 2147483647 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -2147483648 --- +int(-1) +--- testing: 9223372036854775807 | 9223372034707292160 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -9223372034707292160 --- +int(-1) +--- testing: 9223372036854775807 | 2147483648 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | -2147483649 --- +int(-1) +--- testing: 9223372036854775807 | 4294967294 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 4294967295 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 4294967293 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 9223372036854775806 --- +int(9223372036854775807) +--- testing: 9223372036854775807 | 9.2233720368548E+18 --- +int(-1) +--- testing: 9223372036854775807 | -9223372036854775807 --- +int(-1) +--- testing: 9223372036854775807 | -9.2233720368548E+18 --- +int(-1) +===DONE=== + \ No newline at end of file diff --git a/tests/lang/operators/bitwiseOr_variationStr.phpt b/tests/lang/operators/bitwiseOr_variationStr.phpt new file mode 100644 index 0000000..6c31477 --- /dev/null +++ b/tests/lang/operators/bitwiseOr_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test | operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' | '0' --- +string(2) "30" +--- testing: '0' | '65' --- +string(4) "3635" +--- testing: '0' | '-44' --- +string(6) "3d3434" +--- testing: '0' | '1.2' --- +string(6) "312e32" +--- testing: '0' | '-7.7' --- +string(8) "3d372e37" +--- testing: '0' | 'abc' --- +string(6) "716263" +--- testing: '0' | '123abc' --- +string(12) "313233616263" +--- testing: '0' | '123e5' --- +string(10) "3132336535" +--- testing: '0' | '123e5xyz' --- +string(16) "313233653578797a" +--- testing: '0' | ' 123abc' --- +string(14) "30313233616263" +--- testing: '0' | '123 abc' --- +string(14) "31323320616263" +--- testing: '0' | '123abc ' --- +string(14) "31323361626320" +--- testing: '0' | '3.4a' --- +string(8) "332e3461" +--- testing: '0' | 'a5.9' --- +string(8) "71352e39" +--- testing: '65' | '0' --- +string(4) "3635" +--- testing: '65' | '65' --- +string(4) "3635" +--- testing: '65' | '-44' --- +string(6) "3f3534" +--- testing: '65' | '1.2' --- +string(6) "373f32" +--- testing: '65' | '-7.7' --- +string(8) "3f372e37" +--- testing: '65' | 'abc' --- +string(6) "777763" +--- testing: '65' | '123abc' --- +string(12) "373733616263" +--- testing: '65' | '123e5' --- +string(10) "3737336535" +--- testing: '65' | '123e5xyz' --- +string(16) "373733653578797a" +--- testing: '65' | ' 123abc' --- +string(14) "36353233616263" +--- testing: '65' | '123 abc' --- +string(14) "37373320616263" +--- testing: '65' | '123abc ' --- +string(14) "37373361626320" +--- testing: '65' | '3.4a' --- +string(8) "373f3461" +--- testing: '65' | 'a5.9' --- +string(8) "77352e39" +--- testing: '-44' | '0' --- +string(6) "3d3434" +--- testing: '-44' | '65' --- +string(6) "3f3534" +--- testing: '-44' | '-44' --- +string(6) "2d3434" +--- testing: '-44' | '1.2' --- +string(6) "3d3e36" +--- testing: '-44' | '-7.7' --- +string(8) "2d373e37" +--- testing: '-44' | 'abc' --- +string(6) "6d7677" +--- testing: '-44' | '123abc' --- +string(12) "3d3637616263" +--- testing: '-44' | '123e5' --- +string(10) "3d36376535" +--- testing: '-44' | '123e5xyz' --- +string(16) "3d3637653578797a" +--- testing: '-44' | ' 123abc' --- +string(14) "2d353633616263" +--- testing: '-44' | '123 abc' --- +string(14) "3d363720616263" +--- testing: '-44' | '123abc ' --- +string(14) "3d363761626320" +--- testing: '-44' | '3.4a' --- +string(8) "3f3e3461" +--- testing: '-44' | 'a5.9' --- +string(8) "6d353e39" +--- testing: '1.2' | '0' --- +string(6) "312e32" +--- testing: '1.2' | '65' --- +string(6) "373f32" +--- testing: '1.2' | '-44' --- +string(6) "3d3e36" +--- testing: '1.2' | '1.2' --- +string(6) "312e32" +--- testing: '1.2' | '-7.7' --- +string(8) "3d3f3e37" +--- testing: '1.2' | 'abc' --- +string(6) "716e73" +--- testing: '1.2' | '123abc' --- +string(12) "313e33616263" +--- testing: '1.2' | '123e5' --- +string(10) "313e336535" +--- testing: '1.2' | '123e5xyz' --- +string(16) "313e33653578797a" +--- testing: '1.2' | ' 123abc' --- +string(14) "313f3233616263" +--- testing: '1.2' | '123 abc' --- +string(14) "313e3320616263" +--- testing: '1.2' | '123abc ' --- +string(14) "313e3361626320" +--- testing: '1.2' | '3.4a' --- +string(8) "332e3661" +--- testing: '1.2' | 'a5.9' --- +string(8) "713f3e39" +--- testing: '-7.7' | '0' --- +string(8) "3d372e37" +--- testing: '-7.7' | '65' --- +string(8) "3f372e37" +--- testing: '-7.7' | '-44' --- +string(8) "2d373e37" +--- testing: '-7.7' | '1.2' --- +string(8) "3d3f3e37" +--- testing: '-7.7' | '-7.7' --- +string(8) "2d372e37" +--- testing: '-7.7' | 'abc' --- +string(8) "6d776f37" +--- testing: '-7.7' | '123abc' --- +string(12) "3d373f776263" +--- testing: '-7.7' | '123e5' --- +string(10) "3d373f7735" +--- testing: '-7.7' | '123e5xyz' --- +string(16) "3d373f773578797a" +--- testing: '-7.7' | ' 123abc' --- +string(14) "2d373e37616263" +--- testing: '-7.7' | '123 abc' --- +string(14) "3d373f37616263" +--- testing: '-7.7' | '123abc ' --- +string(14) "3d373f77626320" +--- testing: '-7.7' | '3.4a' --- +string(8) "3f3f3e77" +--- testing: '-7.7' | 'a5.9' --- +string(8) "6d372e3f" +--- testing: 'abc' | '0' --- +string(6) "716263" +--- testing: 'abc' | '65' --- +string(6) "777763" +--- testing: 'abc' | '-44' --- +string(6) "6d7677" +--- testing: 'abc' | '1.2' --- +string(6) "716e73" +--- testing: 'abc' | '-7.7' --- +string(8) "6d776f37" +--- testing: 'abc' | 'abc' --- +string(6) "616263" +--- testing: 'abc' | '123abc' --- +string(12) "717273616263" +--- testing: 'abc' | '123e5' --- +string(10) "7172736535" +--- testing: 'abc' | '123e5xyz' --- +string(16) "717273653578797a" +--- testing: 'abc' | ' 123abc' --- +string(14) "61737333616263" +--- testing: 'abc' | '123 abc' --- +string(14) "71727320616263" +--- testing: 'abc' | '123abc ' --- +string(14) "71727361626320" +--- testing: 'abc' | '3.4a' --- +string(8) "736e7761" +--- testing: 'abc' | 'a5.9' --- +string(8) "61776f39" +--- testing: '123abc' | '0' --- +string(12) "313233616263" +--- testing: '123abc' | '65' --- +string(12) "373733616263" +--- testing: '123abc' | '-44' --- +string(12) "3d3637616263" +--- testing: '123abc' | '1.2' --- +string(12) "313e33616263" +--- testing: '123abc' | '-7.7' --- +string(12) "3d373f776263" +--- testing: '123abc' | 'abc' --- +string(12) "717273616263" +--- testing: '123abc' | '123abc' --- +string(12) "313233616263" +--- testing: '123abc' | '123e5' --- +string(12) "313233657763" +--- testing: '123abc' | '123e5xyz' --- +string(16) "31323365777b797a" +--- testing: '123abc' | ' 123abc' --- +string(14) "31333373636363" +--- testing: '123abc' | '123 abc' --- +string(14) "31323361636363" +--- testing: '123abc' | '123abc ' --- +string(14) "31323361626320" +--- testing: '123abc' | '3.4a' --- +string(12) "333e37616263" +--- testing: '123abc' | 'a5.9' --- +string(12) "71373f796263" +--- testing: '123e5' | '0' --- +string(10) "3132336535" +--- testing: '123e5' | '65' --- +string(10) "3737336535" +--- testing: '123e5' | '-44' --- +string(10) "3d36376535" +--- testing: '123e5' | '1.2' --- +string(10) "313e336535" +--- testing: '123e5' | '-7.7' --- +string(10) "3d373f7735" +--- testing: '123e5' | 'abc' --- +string(10) "7172736535" +--- testing: '123e5' | '123abc' --- +string(12) "313233657763" +--- testing: '123e5' | '123e5' --- +string(10) "3132336535" +--- testing: '123e5' | '123e5xyz' --- +string(16) "313233653578797a" +--- testing: '123e5' | ' 123abc' --- +string(14) "31333377756263" +--- testing: '123e5' | '123 abc' --- +string(14) "31323365756263" +--- testing: '123e5' | '123abc ' --- +string(14) "31323365776320" +--- testing: '123e5' | '3.4a' --- +string(10) "333e376535" +--- testing: '123e5' | 'a5.9' --- +string(10) "71373f7d35" +--- testing: '123e5xyz' | '0' --- +string(16) "313233653578797a" +--- testing: '123e5xyz' | '65' --- +string(16) "373733653578797a" +--- testing: '123e5xyz' | '-44' --- +string(16) "3d3637653578797a" +--- testing: '123e5xyz' | '1.2' --- +string(16) "313e33653578797a" +--- testing: '123e5xyz' | '-7.7' --- +string(16) "3d373f773578797a" +--- testing: '123e5xyz' | 'abc' --- +string(16) "717273653578797a" +--- testing: '123e5xyz' | '123abc' --- +string(16) "31323365777b797a" +--- testing: '123e5xyz' | '123e5' --- +string(16) "313233653578797a" +--- testing: '123e5xyz' | '123e5xyz' --- +string(16) "313233653578797a" +--- testing: '123e5xyz' | ' 123abc' --- +string(16) "31333377757a7b7a" +--- testing: '123e5xyz' | '123 abc' --- +string(16) "31323365757a7b7a" +--- testing: '123e5xyz' | '123abc ' --- +string(16) "31323365777b797a" +--- testing: '123e5xyz' | '3.4a' --- +string(16) "333e37653578797a" +--- testing: '123e5xyz' | 'a5.9' --- +string(16) "71373f7d3578797a" +--- testing: ' 123abc' | '0' --- +string(14) "30313233616263" +--- testing: ' 123abc' | '65' --- +string(14) "36353233616263" +--- testing: ' 123abc' | '-44' --- +string(14) "2d353633616263" +--- testing: ' 123abc' | '1.2' --- +string(14) "313f3233616263" +--- testing: ' 123abc' | '-7.7' --- +string(14) "2d373e37616263" +--- testing: ' 123abc' | 'abc' --- +string(14) "61737333616263" +--- testing: ' 123abc' | '123abc' --- +string(14) "31333373636363" +--- testing: ' 123abc' | '123e5' --- +string(14) "31333377756263" +--- testing: ' 123abc' | '123e5xyz' --- +string(16) "31333377757a7b7a" +--- testing: ' 123abc' | ' 123abc' --- +string(14) "20313233616263" +--- testing: ' 123abc' | '123 abc' --- +string(14) "31333333616263" +--- testing: ' 123abc' | '123abc ' --- +string(14) "31333373636363" +--- testing: ' 123abc' | '3.4a' --- +string(14) "333f3673616263" +--- testing: ' 123abc' | 'a5.9' --- +string(14) "61353e3b616263" +--- testing: '123 abc' | '0' --- +string(14) "31323320616263" +--- testing: '123 abc' | '65' --- +string(14) "37373320616263" +--- testing: '123 abc' | '-44' --- +string(14) "3d363720616263" +--- testing: '123 abc' | '1.2' --- +string(14) "313e3320616263" +--- testing: '123 abc' | '-7.7' --- +string(14) "3d373f37616263" +--- testing: '123 abc' | 'abc' --- +string(14) "71727320616263" +--- testing: '123 abc' | '123abc' --- +string(14) "31323361636363" +--- testing: '123 abc' | '123e5' --- +string(14) "31323365756263" +--- testing: '123 abc' | '123e5xyz' --- +string(16) "31323365757a7b7a" +--- testing: '123 abc' | ' 123abc' --- +string(14) "31333333616263" +--- testing: '123 abc' | '123 abc' --- +string(14) "31323320616263" +--- testing: '123 abc' | '123abc ' --- +string(14) "31323361636363" +--- testing: '123 abc' | '3.4a' --- +string(14) "333e3761616263" +--- testing: '123 abc' | 'a5.9' --- +string(14) "71373f39616263" +--- testing: '123abc ' | '0' --- +string(14) "31323361626320" +--- testing: '123abc ' | '65' --- +string(14) "37373361626320" +--- testing: '123abc ' | '-44' --- +string(14) "3d363761626320" +--- testing: '123abc ' | '1.2' --- +string(14) "313e3361626320" +--- testing: '123abc ' | '-7.7' --- +string(14) "3d373f77626320" +--- testing: '123abc ' | 'abc' --- +string(14) "71727361626320" +--- testing: '123abc ' | '123abc' --- +string(14) "31323361626320" +--- testing: '123abc ' | '123e5' --- +string(14) "31323365776320" +--- testing: '123abc ' | '123e5xyz' --- +string(16) "31323365777b797a" +--- testing: '123abc ' | ' 123abc' --- +string(14) "31333373636363" +--- testing: '123abc ' | '123 abc' --- +string(14) "31323361636363" +--- testing: '123abc ' | '123abc ' --- +string(14) "31323361626320" +--- testing: '123abc ' | '3.4a' --- +string(14) "333e3761626320" +--- testing: '123abc ' | 'a5.9' --- +string(14) "71373f79626320" +--- testing: '3.4a' | '0' --- +string(8) "332e3461" +--- testing: '3.4a' | '65' --- +string(8) "373f3461" +--- testing: '3.4a' | '-44' --- +string(8) "3f3e3461" +--- testing: '3.4a' | '1.2' --- +string(8) "332e3661" +--- testing: '3.4a' | '-7.7' --- +string(8) "3f3f3e77" +--- testing: '3.4a' | 'abc' --- +string(8) "736e7761" +--- testing: '3.4a' | '123abc' --- +string(12) "333e37616263" +--- testing: '3.4a' | '123e5' --- +string(10) "333e376535" +--- testing: '3.4a' | '123e5xyz' --- +string(16) "333e37653578797a" +--- testing: '3.4a' | ' 123abc' --- +string(14) "333f3673616263" +--- testing: '3.4a' | '123 abc' --- +string(14) "333e3761616263" +--- testing: '3.4a' | '123abc ' --- +string(14) "333e3761626320" +--- testing: '3.4a' | '3.4a' --- +string(8) "332e3461" +--- testing: '3.4a' | 'a5.9' --- +string(8) "733f3e79" +--- testing: 'a5.9' | '0' --- +string(8) "71352e39" +--- testing: 'a5.9' | '65' --- +string(8) "77352e39" +--- testing: 'a5.9' | '-44' --- +string(8) "6d353e39" +--- testing: 'a5.9' | '1.2' --- +string(8) "713f3e39" +--- testing: 'a5.9' | '-7.7' --- +string(8) "6d372e3f" +--- testing: 'a5.9' | 'abc' --- +string(8) "61776f39" +--- testing: 'a5.9' | '123abc' --- +string(12) "71373f796263" +--- testing: 'a5.9' | '123e5' --- +string(10) "71373f7d35" +--- testing: 'a5.9' | '123e5xyz' --- +string(16) "71373f7d3578797a" +--- testing: 'a5.9' | ' 123abc' --- +string(14) "61353e3b616263" +--- testing: 'a5.9' | '123 abc' --- +string(14) "71373f39616263" +--- testing: 'a5.9' | '123abc ' --- +string(14) "71373f79626320" +--- testing: 'a5.9' | '3.4a' --- +string(8) "733f3e79" +--- testing: 'a5.9' | 'a5.9' --- +string(8) "61352e39" +===DONE=== diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt new file mode 100644 index 0000000..24da2d0 --- /dev/null +++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt @@ -0,0 +1,583 @@ +--TEST-- +Test << operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 << 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << 1 --- +int(-2) +--- testing: 9223372036854775807 << -1 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << 7 --- +int(-128) +--- testing: 9223372036854775807 << 9 --- +int(-512) +--- testing: 9223372036854775807 << 65 --- +int(-2) +--- testing: 9223372036854775807 << -44 --- +int(-1048576) +--- testing: 9223372036854775807 << 2147483647 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 << 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 << 1 --- +int(0) +--- testing: -9223372036854775808 << -1 --- +int(0) +--- testing: -9223372036854775808 << 7 --- +int(0) +--- testing: -9223372036854775808 << 9 --- +int(0) +--- testing: -9223372036854775808 << 65 --- +int(0) +--- testing: -9223372036854775808 << -44 --- +int(0) +--- testing: -9223372036854775808 << 2147483647 --- +int(0) +--- testing: -9223372036854775808 << 9223372036854775807 --- +int(0) +--- testing: 2147483647 << 0 --- +int(2147483647) +--- testing: 2147483647 << 1 --- +int(4294967294) +--- testing: 2147483647 << -1 --- +int(-9223372036854775808) +--- testing: 2147483647 << 7 --- +int(274877906816) +--- testing: 2147483647 << 9 --- +int(1099511627264) +--- testing: 2147483647 << 65 --- +int(4294967294) +--- testing: 2147483647 << -44 --- +int(2251799812636672) +--- testing: 2147483647 << 2147483647 --- +int(-9223372036854775808) +--- testing: 2147483647 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -2147483648 << 0 --- +int(-2147483648) +--- testing: -2147483648 << 1 --- +int(-4294967296) +--- testing: -2147483648 << -1 --- +int(0) +--- testing: -2147483648 << 7 --- +int(-274877906944) +--- testing: -2147483648 << 9 --- +int(-1099511627776) +--- testing: -2147483648 << 65 --- +int(-4294967296) +--- testing: -2147483648 << -44 --- +int(-2251799813685248) +--- testing: -2147483648 << 2147483647 --- +int(0) +--- testing: -2147483648 << 9223372036854775807 --- +int(0) +--- testing: 9223372034707292160 << 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 << 1 --- +int(-4294967296) +--- testing: 9223372034707292160 << -1 --- +int(0) +--- testing: 9223372034707292160 << 7 --- +int(-274877906944) +--- testing: 9223372034707292160 << 9 --- +int(-1099511627776) +--- testing: 9223372034707292160 << 65 --- +int(-4294967296) +--- testing: 9223372034707292160 << -44 --- +int(-2251799813685248) +--- testing: 9223372034707292160 << 2147483647 --- +int(0) +--- testing: 9223372034707292160 << 9223372036854775807 --- +int(0) +--- testing: -9223372034707292160 << 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 << 1 --- +int(4294967296) +--- testing: -9223372034707292160 << -1 --- +int(0) +--- testing: -9223372034707292160 << 7 --- +int(274877906944) +--- testing: -9223372034707292160 << 9 --- +int(1099511627776) +--- testing: -9223372034707292160 << 65 --- +int(4294967296) +--- testing: -9223372034707292160 << -44 --- +int(2251799813685248) +--- testing: -9223372034707292160 << 2147483647 --- +int(0) +--- testing: -9223372034707292160 << 9223372036854775807 --- +int(0) +--- testing: 2147483648 << 0 --- +int(2147483648) +--- testing: 2147483648 << 1 --- +int(4294967296) +--- testing: 2147483648 << -1 --- +int(0) +--- testing: 2147483648 << 7 --- +int(274877906944) +--- testing: 2147483648 << 9 --- +int(1099511627776) +--- testing: 2147483648 << 65 --- +int(4294967296) +--- testing: 2147483648 << -44 --- +int(2251799813685248) +--- testing: 2147483648 << 2147483647 --- +int(0) +--- testing: 2147483648 << 9223372036854775807 --- +int(0) +--- testing: -2147483649 << 0 --- +int(-2147483649) +--- testing: -2147483649 << 1 --- +int(-4294967298) +--- testing: -2147483649 << -1 --- +int(-9223372036854775808) +--- testing: -2147483649 << 7 --- +int(-274877907072) +--- testing: -2147483649 << 9 --- +int(-1099511628288) +--- testing: -2147483649 << 65 --- +int(-4294967298) +--- testing: -2147483649 << -44 --- +int(-2251799814733824) +--- testing: -2147483649 << 2147483647 --- +int(-9223372036854775808) +--- testing: -2147483649 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 4294967294 << 0 --- +int(4294967294) +--- testing: 4294967294 << 1 --- +int(8589934588) +--- testing: 4294967294 << -1 --- +int(0) +--- testing: 4294967294 << 7 --- +int(549755813632) +--- testing: 4294967294 << 9 --- +int(2199023254528) +--- testing: 4294967294 << 65 --- +int(8589934588) +--- testing: 4294967294 << -44 --- +int(4503599625273344) +--- testing: 4294967294 << 2147483647 --- +int(0) +--- testing: 4294967294 << 9223372036854775807 --- +int(0) +--- testing: 4294967295 << 0 --- +int(4294967295) +--- testing: 4294967295 << 1 --- +int(8589934590) +--- testing: 4294967295 << -1 --- +int(-9223372036854775808) +--- testing: 4294967295 << 7 --- +int(549755813760) +--- testing: 4294967295 << 9 --- +int(2199023255040) +--- testing: 4294967295 << 65 --- +int(8589934590) +--- testing: 4294967295 << -44 --- +int(4503599626321920) +--- testing: 4294967295 << 2147483647 --- +int(-9223372036854775808) +--- testing: 4294967295 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 4294967293 << 0 --- +int(4294967293) +--- testing: 4294967293 << 1 --- +int(8589934586) +--- testing: 4294967293 << -1 --- +int(-9223372036854775808) +--- testing: 4294967293 << 7 --- +int(549755813504) +--- testing: 4294967293 << 9 --- +int(2199023254016) +--- testing: 4294967293 << 65 --- +int(8589934586) +--- testing: 4294967293 << -44 --- +int(4503599624224768) +--- testing: 4294967293 << 2147483647 --- +int(-9223372036854775808) +--- testing: 4294967293 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 9223372036854775806 << 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 << 1 --- +int(-4) +--- testing: 9223372036854775806 << -1 --- +int(0) +--- testing: 9223372036854775806 << 7 --- +int(-256) +--- testing: 9223372036854775806 << 9 --- +int(-1024) +--- testing: 9223372036854775806 << 65 --- +int(-4) +--- testing: 9223372036854775806 << -44 --- +int(-2097152) +--- testing: 9223372036854775806 << 2147483647 --- +int(0) +--- testing: 9223372036854775806 << 9223372036854775807 --- +int(0) +--- testing: 9.2233720368548E+18 << 0 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 << 1 --- +int(0) +--- testing: 9.2233720368548E+18 << -1 --- +int(0) +--- testing: 9.2233720368548E+18 << 7 --- +int(0) +--- testing: 9.2233720368548E+18 << 9 --- +int(0) +--- testing: 9.2233720368548E+18 << 65 --- +int(0) +--- testing: 9.2233720368548E+18 << -44 --- +int(0) +--- testing: 9.2233720368548E+18 << 2147483647 --- +int(0) +--- testing: 9.2233720368548E+18 << 9223372036854775807 --- +int(0) +--- testing: -9223372036854775807 << 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 << 1 --- +int(2) +--- testing: -9223372036854775807 << -1 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 << 7 --- +int(128) +--- testing: -9223372036854775807 << 9 --- +int(512) +--- testing: -9223372036854775807 << 65 --- +int(2) +--- testing: -9223372036854775807 << -44 --- +int(1048576) +--- testing: -9223372036854775807 << 2147483647 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 << 0 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 << 1 --- +int(0) +--- testing: -9.2233720368548E+18 << -1 --- +int(0) +--- testing: -9.2233720368548E+18 << 7 --- +int(0) +--- testing: -9.2233720368548E+18 << 9 --- +int(0) +--- testing: -9.2233720368548E+18 << 65 --- +int(0) +--- testing: -9.2233720368548E+18 << -44 --- +int(0) +--- testing: -9.2233720368548E+18 << 2147483647 --- +int(0) +--- testing: -9.2233720368548E+18 << 9223372036854775807 --- +int(0) +--- testing: 0 << 9223372036854775807 --- +int(0) +--- testing: 0 << -9223372036854775808 --- +int(0) +--- testing: 0 << 2147483647 --- +int(0) +--- testing: 0 << -2147483648 --- +int(0) +--- testing: 0 << 9223372034707292160 --- +int(0) +--- testing: 0 << -9223372034707292160 --- +int(0) +--- testing: 0 << 2147483648 --- +int(0) +--- testing: 0 << -2147483649 --- +int(0) +--- testing: 0 << 4294967294 --- +int(0) +--- testing: 0 << 4294967295 --- +int(0) +--- testing: 0 << 4294967293 --- +int(0) +--- testing: 0 << 9223372036854775806 --- +int(0) +--- testing: 0 << 9.2233720368548E+18 --- +int(0) +--- testing: 0 << -9223372036854775807 --- +int(0) +--- testing: 0 << -9.2233720368548E+18 --- +int(0) +--- testing: 1 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 1 << -9223372036854775808 --- +int(1) +--- testing: 1 << 2147483647 --- +int(-9223372036854775808) +--- testing: 1 << -2147483648 --- +int(1) +--- testing: 1 << 9223372034707292160 --- +int(1) +--- testing: 1 << -9223372034707292160 --- +int(1) +--- testing: 1 << 2147483648 --- +int(1) +--- testing: 1 << -2147483649 --- +int(-9223372036854775808) +--- testing: 1 << 4294967294 --- +int(4611686018427387904) +--- testing: 1 << 4294967295 --- +int(-9223372036854775808) +--- testing: 1 << 4294967293 --- +int(2305843009213693952) +--- testing: 1 << 9223372036854775806 --- +int(4611686018427387904) +--- testing: 1 << 9.2233720368548E+18 --- +int(1) +--- testing: 1 << -9223372036854775807 --- +int(2) +--- testing: 1 << -9.2233720368548E+18 --- +int(1) +--- testing: -1 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -1 << -9223372036854775808 --- +int(-1) +--- testing: -1 << 2147483647 --- +int(-9223372036854775808) +--- testing: -1 << -2147483648 --- +int(-1) +--- testing: -1 << 9223372034707292160 --- +int(-1) +--- testing: -1 << -9223372034707292160 --- +int(-1) +--- testing: -1 << 2147483648 --- +int(-1) +--- testing: -1 << -2147483649 --- +int(-9223372036854775808) +--- testing: -1 << 4294967294 --- +int(-4611686018427387904) +--- testing: -1 << 4294967295 --- +int(-9223372036854775808) +--- testing: -1 << 4294967293 --- +int(-2305843009213693952) +--- testing: -1 << 9223372036854775806 --- +int(-4611686018427387904) +--- testing: -1 << 9.2233720368548E+18 --- +int(-1) +--- testing: -1 << -9223372036854775807 --- +int(-2) +--- testing: -1 << -9.2233720368548E+18 --- +int(-1) +--- testing: 7 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 7 << -9223372036854775808 --- +int(7) +--- testing: 7 << 2147483647 --- +int(-9223372036854775808) +--- testing: 7 << -2147483648 --- +int(7) +--- testing: 7 << 9223372034707292160 --- +int(7) +--- testing: 7 << -9223372034707292160 --- +int(7) +--- testing: 7 << 2147483648 --- +int(7) +--- testing: 7 << -2147483649 --- +int(-9223372036854775808) +--- testing: 7 << 4294967294 --- +int(-4611686018427387904) +--- testing: 7 << 4294967295 --- +int(-9223372036854775808) +--- testing: 7 << 4294967293 --- +int(-2305843009213693952) +--- testing: 7 << 9223372036854775806 --- +int(-4611686018427387904) +--- testing: 7 << 9.2233720368548E+18 --- +int(7) +--- testing: 7 << -9223372036854775807 --- +int(14) +--- testing: 7 << -9.2233720368548E+18 --- +int(7) +--- testing: 9 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 9 << -9223372036854775808 --- +int(9) +--- testing: 9 << 2147483647 --- +int(-9223372036854775808) +--- testing: 9 << -2147483648 --- +int(9) +--- testing: 9 << 9223372034707292160 --- +int(9) +--- testing: 9 << -9223372034707292160 --- +int(9) +--- testing: 9 << 2147483648 --- +int(9) +--- testing: 9 << -2147483649 --- +int(-9223372036854775808) +--- testing: 9 << 4294967294 --- +int(4611686018427387904) +--- testing: 9 << 4294967295 --- +int(-9223372036854775808) +--- testing: 9 << 4294967293 --- +int(2305843009213693952) +--- testing: 9 << 9223372036854775806 --- +int(4611686018427387904) +--- testing: 9 << 9.2233720368548E+18 --- +int(9) +--- testing: 9 << -9223372036854775807 --- +int(18) +--- testing: 9 << -9.2233720368548E+18 --- +int(9) +--- testing: 65 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 65 << -9223372036854775808 --- +int(65) +--- testing: 65 << 2147483647 --- +int(-9223372036854775808) +--- testing: 65 << -2147483648 --- +int(65) +--- testing: 65 << 9223372034707292160 --- +int(65) +--- testing: 65 << -9223372034707292160 --- +int(65) +--- testing: 65 << 2147483648 --- +int(65) +--- testing: 65 << -2147483649 --- +int(-9223372036854775808) +--- testing: 65 << 4294967294 --- +int(4611686018427387904) +--- testing: 65 << 4294967295 --- +int(-9223372036854775808) +--- testing: 65 << 4294967293 --- +int(2305843009213693952) +--- testing: 65 << 9223372036854775806 --- +int(4611686018427387904) +--- testing: 65 << 9.2233720368548E+18 --- +int(65) +--- testing: 65 << -9223372036854775807 --- +int(130) +--- testing: 65 << -9.2233720368548E+18 --- +int(65) +--- testing: -44 << 9223372036854775807 --- +int(0) +--- testing: -44 << -9223372036854775808 --- +int(-44) +--- testing: -44 << 2147483647 --- +int(0) +--- testing: -44 << -2147483648 --- +int(-44) +--- testing: -44 << 9223372034707292160 --- +int(-44) +--- testing: -44 << -9223372034707292160 --- +int(-44) +--- testing: -44 << 2147483648 --- +int(-44) +--- testing: -44 << -2147483649 --- +int(0) +--- testing: -44 << 4294967294 --- +int(0) +--- testing: -44 << 4294967295 --- +int(0) +--- testing: -44 << 4294967293 --- +int(-9223372036854775808) +--- testing: -44 << 9223372036854775806 --- +int(0) +--- testing: -44 << 9.2233720368548E+18 --- +int(-44) +--- testing: -44 << -9223372036854775807 --- +int(-88) +--- testing: -44 << -9.2233720368548E+18 --- +int(-44) +--- testing: 2147483647 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 2147483647 << -9223372036854775808 --- +int(2147483647) +--- testing: 2147483647 << 2147483647 --- +int(-9223372036854775808) +--- testing: 2147483647 << -2147483648 --- +int(2147483647) +--- testing: 2147483647 << 9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 << -9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 << 2147483648 --- +int(2147483647) +--- testing: 2147483647 << -2147483649 --- +int(-9223372036854775808) +--- testing: 2147483647 << 4294967294 --- +int(-4611686018427387904) +--- testing: 2147483647 << 4294967295 --- +int(-9223372036854775808) +--- testing: 2147483647 << 4294967293 --- +int(-2305843009213693952) +--- testing: 2147483647 << 9223372036854775806 --- +int(-4611686018427387904) +--- testing: 2147483647 << 9.2233720368548E+18 --- +int(2147483647) +--- testing: 2147483647 << -9223372036854775807 --- +int(4294967294) +--- testing: 2147483647 << -9.2233720368548E+18 --- +int(2147483647) +--- testing: 9223372036854775807 << 9223372036854775807 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << -9223372036854775808 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << 2147483647 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << -2147483648 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << 9223372034707292160 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << -9223372034707292160 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << 2147483648 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << -2147483649 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << 4294967294 --- +int(-4611686018427387904) +--- testing: 9223372036854775807 << 4294967295 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 << 4294967293 --- +int(-2305843009213693952) +--- testing: 9223372036854775807 << 9223372036854775806 --- +int(-4611686018427387904) +--- testing: 9223372036854775807 << 9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: 9223372036854775807 << -9223372036854775807 --- +int(-2) +--- testing: 9223372036854775807 << -9.2233720368548E+18 --- +int(9223372036854775807) +===DONE=== + \ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt new file mode 100644 index 0000000..b1bc437 --- /dev/null +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -0,0 +1,421 @@ +--TEST-- +Test << operator : various numbers as strings +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' << '0' --- +string(2) "30" +--- testing: '0' << '65' --- +string(2) "30" +--- testing: '0' << '-44' --- +string(2) "30" +--- testing: '0' << '1.2' --- +string(2) "30" +--- testing: '0' << '-7.7' --- +string(2) "30" +--- testing: '0' << 'abc' --- +string(2) "30" +--- testing: '0' << '123abc' --- +string(2) "30" +--- testing: '0' << '123e5' --- +string(2) "30" +--- testing: '0' << '123e5xyz' --- +string(2) "30" +--- testing: '0' << ' 123abc' --- +string(2) "30" +--- testing: '0' << '123 abc' --- +string(2) "30" +--- testing: '0' << '123abc ' --- +string(2) "30" +--- testing: '0' << '3.4a' --- +string(2) "30" +--- testing: '0' << 'a5.9' --- +string(2) "30" +--- testing: '65' << '0' --- +string(4) "3635" +--- testing: '65' << '65' --- +string(6) "313330" +--- testing: '65' << '-44' --- +string(16) "3638313537343430" +--- testing: '65' << '1.2' --- +string(6) "313330" +--- testing: '65' << '-7.7' --- +string(22) "2d32313133393239323136" +--- testing: '65' << 'abc' --- +string(4) "3635" +--- testing: '65' << '123abc' --- +string(18) "313334323137373238" +--- testing: '65' << '123e5' --- +string(18) "313334323137373238" +--- testing: '65' << '123e5xyz' --- +string(18) "313334323137373238" +--- testing: '65' << ' 123abc' --- +string(18) "313334323137373238" +--- testing: '65' << '123 abc' --- +string(18) "313334323137373238" +--- testing: '65' << '123abc ' --- +string(18) "313334323137373238" +--- testing: '65' << '3.4a' --- +string(6) "353230" +--- testing: '65' << 'a5.9' --- +string(4) "3635" +--- testing: '-44' << '0' --- +string(6) "2d3434" +--- testing: '-44' << '65' --- +string(6) "2d3838" +--- testing: '-44' << '-44' --- +string(18) "2d3436313337333434" +--- testing: '-44' << '1.2' --- +string(6) "2d3838" +--- testing: '-44' << '-7.7' --- +string(22) "2d31343736333935303038" +--- testing: '-44' << 'abc' --- +string(6) "2d3434" +--- testing: '-44' << '123abc' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << '123e5' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << '123e5xyz' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << ' 123abc' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << '123 abc' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << '123abc ' --- +string(22) "2d31363130363132373336" +--- testing: '-44' << '3.4a' --- +string(8) "2d333532" +--- testing: '-44' << 'a5.9' --- +string(6) "2d3434" +--- testing: '1.2' << '0' --- +string(2) "31" +--- testing: '1.2' << '65' --- +string(2) "32" +--- testing: '1.2' << '-44' --- +string(14) "31303438353736" +--- testing: '1.2' << '1.2' --- +string(2) "32" +--- testing: '1.2' << '-7.7' --- +string(16) "3333353534343332" +--- testing: '1.2' << 'abc' --- +string(2) "31" +--- testing: '1.2' << '123abc' --- +string(18) "313334323137373238" +--- testing: '1.2' << '123e5' --- +string(18) "313334323137373238" +--- testing: '1.2' << '123e5xyz' --- +string(18) "313334323137373238" +--- testing: '1.2' << ' 123abc' --- +string(18) "313334323137373238" +--- testing: '1.2' << '123 abc' --- +string(18) "313334323137373238" +--- testing: '1.2' << '123abc ' --- +string(18) "313334323137373238" +--- testing: '1.2' << '3.4a' --- +string(2) "38" +--- testing: '1.2' << 'a5.9' --- +string(2) "31" +--- testing: '-7.7' << '0' --- +string(4) "2d37" +--- testing: '-7.7' << '65' --- +string(6) "2d3134" +--- testing: '-7.7' << '-44' --- +string(16) "2d37333430303332" +--- testing: '-7.7' << '1.2' --- +string(6) "2d3134" +--- testing: '-7.7' << '-7.7' --- +string(20) "2d323334383831303234" +--- testing: '-7.7' << 'abc' --- +string(4) "2d37" +--- testing: '-7.7' << '123abc' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << '123e5' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << '123e5xyz' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << ' 123abc' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << '123 abc' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << '123abc ' --- +string(20) "2d393339353234303936" +--- testing: '-7.7' << '3.4a' --- +string(6) "2d3536" +--- testing: '-7.7' << 'a5.9' --- +string(4) "2d37" +--- testing: 'abc' << '0' --- +string(2) "30" +--- testing: 'abc' << '65' --- +string(2) "30" +--- testing: 'abc' << '-44' --- +string(2) "30" +--- testing: 'abc' << '1.2' --- +string(2) "30" +--- testing: 'abc' << '-7.7' --- +string(2) "30" +--- testing: 'abc' << 'abc' --- +string(2) "30" +--- testing: 'abc' << '123abc' --- +string(2) "30" +--- testing: 'abc' << '123e5' --- +string(2) "30" +--- testing: 'abc' << '123e5xyz' --- +string(2) "30" +--- testing: 'abc' << ' 123abc' --- +string(2) "30" +--- testing: 'abc' << '123 abc' --- +string(2) "30" +--- testing: 'abc' << '123abc ' --- +string(2) "30" +--- testing: 'abc' << '3.4a' --- +string(2) "30" +--- testing: 'abc' << 'a5.9' --- +string(2) "30" +--- testing: '123abc' << '0' --- +string(6) "313233" +--- testing: '123abc' << '65' --- +string(6) "323436" +--- testing: '123abc' << '-44' --- +string(18) "313238393734383438" +--- testing: '123abc' << '1.2' --- +string(6) "323436" +--- testing: '123abc' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: '123abc' << 'abc' --- +string(6) "313233" +--- testing: '123abc' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: '123abc' << '3.4a' --- +string(6) "393834" +--- testing: '123abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123e5' << '0' --- +string(6) "313233" +--- testing: '123e5' << '65' --- +string(6) "323436" +--- testing: '123e5' << '-44' --- +string(18) "313238393734383438" +--- testing: '123e5' << '1.2' --- +string(6) "323436" +--- testing: '123e5' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: '123e5' << 'abc' --- +string(6) "313233" +--- testing: '123e5' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: '123e5' << '3.4a' --- +string(6) "393834" +--- testing: '123e5' << 'a5.9' --- +string(6) "313233" +--- testing: '123e5xyz' << '0' --- +string(6) "313233" +--- testing: '123e5xyz' << '65' --- +string(6) "323436" +--- testing: '123e5xyz' << '-44' --- +string(18) "313238393734383438" +--- testing: '123e5xyz' << '1.2' --- +string(6) "323436" +--- testing: '123e5xyz' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: '123e5xyz' << 'abc' --- +string(6) "313233" +--- testing: '123e5xyz' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: '123e5xyz' << '3.4a' --- +string(6) "393834" +--- testing: '123e5xyz' << 'a5.9' --- +string(6) "313233" +--- testing: ' 123abc' << '0' --- +string(6) "313233" +--- testing: ' 123abc' << '65' --- +string(6) "323436" +--- testing: ' 123abc' << '-44' --- +string(18) "313238393734383438" +--- testing: ' 123abc' << '1.2' --- +string(6) "323436" +--- testing: ' 123abc' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: ' 123abc' << 'abc' --- +string(6) "313233" +--- testing: ' 123abc' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: ' 123abc' << '3.4a' --- +string(6) "393834" +--- testing: ' 123abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123 abc' << '0' --- +string(6) "313233" +--- testing: '123 abc' << '65' --- +string(6) "323436" +--- testing: '123 abc' << '-44' --- +string(18) "313238393734383438" +--- testing: '123 abc' << '1.2' --- +string(6) "323436" +--- testing: '123 abc' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: '123 abc' << 'abc' --- +string(6) "313233" +--- testing: '123 abc' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: '123 abc' << '3.4a' --- +string(6) "393834" +--- testing: '123 abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123abc ' << '0' --- +string(6) "313233" +--- testing: '123abc ' << '65' --- +string(6) "323436" +--- testing: '123abc ' << '-44' --- +string(18) "313238393734383438" +--- testing: '123abc ' << '1.2' --- +string(6) "323436" +--- testing: '123abc ' << '-7.7' --- +string(20) "2d313637373732313630" +--- testing: '123abc ' << 'abc' --- +string(6) "313233" +--- testing: '123abc ' << '123abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << '123e5' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << '123e5xyz' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << ' 123abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << '123 abc' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << '123abc ' --- +string(20) "2d363731303838363430" +--- testing: '123abc ' << '3.4a' --- +string(6) "393834" +--- testing: '123abc ' << 'a5.9' --- +string(6) "313233" +--- testing: '3.4a' << '0' --- +string(2) "33" +--- testing: '3.4a' << '65' --- +string(2) "36" +--- testing: '3.4a' << '-44' --- +string(14) "33313435373238" +--- testing: '3.4a' << '1.2' --- +string(2) "36" +--- testing: '3.4a' << '-7.7' --- +string(18) "313030363633323936" +--- testing: '3.4a' << 'abc' --- +string(2) "33" +--- testing: '3.4a' << '123abc' --- +string(18) "343032363533313834" +--- testing: '3.4a' << '123e5' --- +string(18) "343032363533313834" +--- testing: '3.4a' << '123e5xyz' --- +string(18) "343032363533313834" +--- testing: '3.4a' << ' 123abc' --- +string(18) "343032363533313834" +--- testing: '3.4a' << '123 abc' --- +string(18) "343032363533313834" +--- testing: '3.4a' << '123abc ' --- +string(18) "343032363533313834" +--- testing: '3.4a' << '3.4a' --- +string(4) "3234" +--- testing: '3.4a' << 'a5.9' --- +string(2) "33" +--- testing: 'a5.9' << '0' --- +string(2) "30" +--- testing: 'a5.9' << '65' --- +string(2) "30" +--- testing: 'a5.9' << '-44' --- +string(2) "30" +--- testing: 'a5.9' << '1.2' --- +string(2) "30" +--- testing: 'a5.9' << '-7.7' --- +string(2) "30" +--- testing: 'a5.9' << 'abc' --- +string(2) "30" +--- testing: 'a5.9' << '123abc' --- +string(2) "30" +--- testing: 'a5.9' << '123e5' --- +string(2) "30" +--- testing: 'a5.9' << '123e5xyz' --- +string(2) "30" +--- testing: 'a5.9' << ' 123abc' --- +string(2) "30" +--- testing: 'a5.9' << '123 abc' --- +string(2) "30" +--- testing: 'a5.9' << '123abc ' --- +string(2) "30" +--- testing: 'a5.9' << '3.4a' --- +string(2) "30" +--- testing: 'a5.9' << 'a5.9' --- +string(2) "30" +===DONE=== + diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt new file mode 100644 index 0000000..0b697c8 --- /dev/null +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -0,0 +1,420 @@ +--TEST-- +Test << operator : various numbers as strings +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' << '0' --- +string(2) "30" +--- testing: '0' << '65' --- +string(2) "30" +--- testing: '0' << '-44' --- +string(2) "30" +--- testing: '0' << '1.2' --- +string(2) "30" +--- testing: '0' << '-7.7' --- +string(2) "30" +--- testing: '0' << 'abc' --- +string(2) "30" +--- testing: '0' << '123abc' --- +string(2) "30" +--- testing: '0' << '123e5' --- +string(2) "30" +--- testing: '0' << '123e5xyz' --- +string(2) "30" +--- testing: '0' << ' 123abc' --- +string(2) "30" +--- testing: '0' << '123 abc' --- +string(2) "30" +--- testing: '0' << '123abc ' --- +string(2) "30" +--- testing: '0' << '3.4a' --- +string(2) "30" +--- testing: '0' << 'a5.9' --- +string(2) "30" +--- testing: '65' << '0' --- +string(4) "3635" +--- testing: '65' << '65' --- +string(6) "313330" +--- testing: '65' << '-44' --- +string(16) "3638313537343430" +--- testing: '65' << '1.2' --- +string(6) "313330" +--- testing: '65' << '-7.7' --- +string(40) "2d39303739323536383438373738393139393336" +--- testing: '65' << 'abc' --- +string(4) "3635" +--- testing: '65' << '123abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << '123e5' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << '123e5xyz' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << ' 123abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << '123 abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << '123abc ' --- +string(36) "353736343630373532333033343233343838" +--- testing: '65' << '3.4a' --- +string(6) "353230" +--- testing: '65' << 'a5.9' --- +string(4) "3635" +--- testing: '-44' << '0' --- +string(6) "2d3434" +--- testing: '-44' << '65' --- +string(6) "2d3838" +--- testing: '-44' << '-44' --- +string(18) "2d3436313337333434" +--- testing: '-44' << '1.2' --- +string(6) "2d3838" +--- testing: '-44' << '-7.7' --- +string(40) "2d36333431303638323735333337363538333638" +--- testing: '-44' << 'abc' --- +string(6) "2d3434" +--- testing: '-44' << '123abc' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << '123e5' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << '123e5xyz' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << ' 123abc' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << '123 abc' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << '123abc ' --- +string(40) "2d36393137353239303237363431303831383536" +--- testing: '-44' << '3.4a' --- +string(8) "2d333532" +--- testing: '-44' << 'a5.9' --- +string(6) "2d3434" +--- testing: '1.2' << '0' --- +string(2) "31" +--- testing: '1.2' << '65' --- +string(2) "32" +--- testing: '1.2' << '-44' --- +string(14) "31303438353736" +--- testing: '1.2' << '1.2' --- +string(2) "32" +--- testing: '1.2' << '-7.7' --- +string(36) "313434313135313838303735383535383732" +--- testing: '1.2' << 'abc' --- +string(2) "31" +--- testing: '1.2' << '123abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << '123e5' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << '123e5xyz' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << ' 123abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << '123 abc' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << '123abc ' --- +string(36) "353736343630373532333033343233343838" +--- testing: '1.2' << '3.4a' --- +string(2) "38" +--- testing: '1.2' << 'a5.9' --- +string(2) "31" +--- testing: '-7.7' << '0' --- +string(4) "2d37" +--- testing: '-7.7' << '65' --- +string(6) "2d3134" +--- testing: '-7.7' << '-44' --- +string(16) "2d37333430303332" +--- testing: '-7.7' << '1.2' --- +string(6) "2d3134" +--- testing: '-7.7' << '-7.7' --- +string(40) "2d31303038383036333136353330393931313034" +--- testing: '-7.7' << 'abc' --- +string(4) "2d37" +--- testing: '-7.7' << '123abc' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << '123e5' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << '123e5xyz' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << ' 123abc' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << '123 abc' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << '123abc ' --- +string(40) "2d34303335323235323636313233393634343136" +--- testing: '-7.7' << '3.4a' --- +string(6) "2d3536" +--- testing: '-7.7' << 'a5.9' --- +string(4) "2d37" +--- testing: 'abc' << '0' --- +string(2) "30" +--- testing: 'abc' << '65' --- +string(2) "30" +--- testing: 'abc' << '-44' --- +string(2) "30" +--- testing: 'abc' << '1.2' --- +string(2) "30" +--- testing: 'abc' << '-7.7' --- +string(2) "30" +--- testing: 'abc' << 'abc' --- +string(2) "30" +--- testing: 'abc' << '123abc' --- +string(2) "30" +--- testing: 'abc' << '123e5' --- +string(2) "30" +--- testing: 'abc' << '123e5xyz' --- +string(2) "30" +--- testing: 'abc' << ' 123abc' --- +string(2) "30" +--- testing: 'abc' << '123 abc' --- +string(2) "30" +--- testing: 'abc' << '123abc ' --- +string(2) "30" +--- testing: 'abc' << '3.4a' --- +string(2) "30" +--- testing: 'abc' << 'a5.9' --- +string(2) "30" +--- testing: '123abc' << '0' --- +string(6) "313233" +--- testing: '123abc' << '65' --- +string(6) "323436" +--- testing: '123abc' << '-44' --- +string(18) "313238393734383438" +--- testing: '123abc' << '1.2' --- +string(6) "323436" +--- testing: '123abc' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: '123abc' << 'abc' --- +string(6) "313233" +--- testing: '123abc' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc' << '3.4a' --- +string(6) "393834" +--- testing: '123abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123e5' << '0' --- +string(6) "313233" +--- testing: '123e5' << '65' --- +string(6) "323436" +--- testing: '123e5' << '-44' --- +string(18) "313238393734383438" +--- testing: '123e5' << '1.2' --- +string(6) "323436" +--- testing: '123e5' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: '123e5' << 'abc' --- +string(6) "313233" +--- testing: '123e5' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5' << '3.4a' --- +string(6) "393834" +--- testing: '123e5' << 'a5.9' --- +string(6) "313233" +--- testing: '123e5xyz' << '0' --- +string(6) "313233" +--- testing: '123e5xyz' << '65' --- +string(6) "323436" +--- testing: '123e5xyz' << '-44' --- +string(18) "313238393734383438" +--- testing: '123e5xyz' << '1.2' --- +string(6) "323436" +--- testing: '123e5xyz' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: '123e5xyz' << 'abc' --- +string(6) "313233" +--- testing: '123e5xyz' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123e5xyz' << '3.4a' --- +string(6) "393834" +--- testing: '123e5xyz' << 'a5.9' --- +string(6) "313233" +--- testing: ' 123abc' << '0' --- +string(6) "313233" +--- testing: ' 123abc' << '65' --- +string(6) "323436" +--- testing: ' 123abc' << '-44' --- +string(18) "313238393734383438" +--- testing: ' 123abc' << '1.2' --- +string(6) "323436" +--- testing: ' 123abc' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: ' 123abc' << 'abc' --- +string(6) "313233" +--- testing: ' 123abc' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: ' 123abc' << '3.4a' --- +string(6) "393834" +--- testing: ' 123abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123 abc' << '0' --- +string(6) "313233" +--- testing: '123 abc' << '65' --- +string(6) "323436" +--- testing: '123 abc' << '-44' --- +string(18) "313238393734383438" +--- testing: '123 abc' << '1.2' --- +string(6) "323436" +--- testing: '123 abc' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: '123 abc' << 'abc' --- +string(6) "313233" +--- testing: '123 abc' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123 abc' << '3.4a' --- +string(6) "393834" +--- testing: '123 abc' << 'a5.9' --- +string(6) "313233" +--- testing: '123abc ' << '0' --- +string(6) "313233" +--- testing: '123abc ' << '65' --- +string(6) "323436" +--- testing: '123abc ' << '-44' --- +string(18) "313238393734383438" +--- testing: '123abc ' << '1.2' --- +string(6) "323436" +--- testing: '123abc ' << '-7.7' --- +string(38) "2d373230353735393430333739323739333630" +--- testing: '123abc ' << 'abc' --- +string(6) "313233" +--- testing: '123abc ' << '123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << '123e5' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << '123e5xyz' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << ' 123abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << '123 abc' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << '123abc ' --- +string(40) "2d32383832333033373631353137313137343430" +--- testing: '123abc ' << '3.4a' --- +string(6) "393834" +--- testing: '123abc ' << 'a5.9' --- +string(6) "313233" +--- testing: '3.4a' << '0' --- +string(2) "33" +--- testing: '3.4a' << '65' --- +string(2) "36" +--- testing: '3.4a' << '-44' --- +string(14) "33313435373238" +--- testing: '3.4a' << '1.2' --- +string(2) "36" +--- testing: '3.4a' << '-7.7' --- +string(36) "343332333435353634323237353637363136" +--- testing: '3.4a' << 'abc' --- +string(2) "33" +--- testing: '3.4a' << '123abc' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << '123e5' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << '123e5xyz' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << ' 123abc' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << '123 abc' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << '123abc ' --- +string(38) "31373239333832323536393130323730343634" +--- testing: '3.4a' << '3.4a' --- +string(4) "3234" +--- testing: '3.4a' << 'a5.9' --- +string(2) "33" +--- testing: 'a5.9' << '0' --- +string(2) "30" +--- testing: 'a5.9' << '65' --- +string(2) "30" +--- testing: 'a5.9' << '-44' --- +string(2) "30" +--- testing: 'a5.9' << '1.2' --- +string(2) "30" +--- testing: 'a5.9' << '-7.7' --- +string(2) "30" +--- testing: 'a5.9' << 'abc' --- +string(2) "30" +--- testing: 'a5.9' << '123abc' --- +string(2) "30" +--- testing: 'a5.9' << '123e5' --- +string(2) "30" +--- testing: 'a5.9' << '123e5xyz' --- +string(2) "30" +--- testing: 'a5.9' << ' 123abc' --- +string(2) "30" +--- testing: 'a5.9' << '123 abc' --- +string(2) "30" +--- testing: 'a5.9' << '123abc ' --- +string(2) "30" +--- testing: 'a5.9' << '3.4a' --- +string(2) "30" +--- testing: 'a5.9' << 'a5.9' --- +string(2) "30" +===DONE=== diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt new file mode 100644 index 0000000..1029d19 --- /dev/null +++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt @@ -0,0 +1,583 @@ +--TEST-- +Test >> operator : 64bit long tests +--SKIPIF-- + +--FILE-- +> $otherVal ---\n"; + var_dump($longVal>>$otherVal); + } +} + +foreach ($otherVals as $otherVal) { + foreach($longVals as $longVal) { + echo "--- testing: $otherVal >> $longVal ---\n"; + var_dump($otherVal>>$longVal); + } +} + +?> +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 >> 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> 1 --- +int(4611686018427387903) +--- testing: 9223372036854775807 >> -1 --- +int(0) +--- testing: 9223372036854775807 >> 7 --- +int(72057594037927935) +--- testing: 9223372036854775807 >> 9 --- +int(18014398509481983) +--- testing: 9223372036854775807 >> 65 --- +int(4611686018427387903) +--- testing: 9223372036854775807 >> -44 --- +int(8796093022207) +--- testing: 9223372036854775807 >> 2147483647 --- +int(0) +--- testing: 9223372036854775807 >> 9223372036854775807 --- +int(0) +--- testing: -9223372036854775808 >> 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 >> 1 --- +int(-4611686018427387904) +--- testing: -9223372036854775808 >> -1 --- +int(-1) +--- testing: -9223372036854775808 >> 7 --- +int(-72057594037927936) +--- testing: -9223372036854775808 >> 9 --- +int(-18014398509481984) +--- testing: -9223372036854775808 >> 65 --- +int(-4611686018427387904) +--- testing: -9223372036854775808 >> -44 --- +int(-8796093022208) +--- testing: -9223372036854775808 >> 2147483647 --- +int(-1) +--- testing: -9223372036854775808 >> 9223372036854775807 --- +int(-1) +--- testing: 2147483647 >> 0 --- +int(2147483647) +--- testing: 2147483647 >> 1 --- +int(1073741823) +--- testing: 2147483647 >> -1 --- +int(0) +--- testing: 2147483647 >> 7 --- +int(16777215) +--- testing: 2147483647 >> 9 --- +int(4194303) +--- testing: 2147483647 >> 65 --- +int(1073741823) +--- testing: 2147483647 >> -44 --- +int(2047) +--- testing: 2147483647 >> 2147483647 --- +int(0) +--- testing: 2147483647 >> 9223372036854775807 --- +int(0) +--- testing: -2147483648 >> 0 --- +int(-2147483648) +--- testing: -2147483648 >> 1 --- +int(-1073741824) +--- testing: -2147483648 >> -1 --- +int(-1) +--- testing: -2147483648 >> 7 --- +int(-16777216) +--- testing: -2147483648 >> 9 --- +int(-4194304) +--- testing: -2147483648 >> 65 --- +int(-1073741824) +--- testing: -2147483648 >> -44 --- +int(-2048) +--- testing: -2147483648 >> 2147483647 --- +int(-1) +--- testing: -2147483648 >> 9223372036854775807 --- +int(-1) +--- testing: 9223372034707292160 >> 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 >> 1 --- +int(4611686017353646080) +--- testing: 9223372034707292160 >> -1 --- +int(0) +--- testing: 9223372034707292160 >> 7 --- +int(72057594021150720) +--- testing: 9223372034707292160 >> 9 --- +int(18014398505287680) +--- testing: 9223372034707292160 >> 65 --- +int(4611686017353646080) +--- testing: 9223372034707292160 >> -44 --- +int(8796093020160) +--- testing: 9223372034707292160 >> 2147483647 --- +int(0) +--- testing: 9223372034707292160 >> 9223372036854775807 --- +int(0) +--- testing: -9223372034707292160 >> 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 >> 1 --- +int(-4611686017353646080) +--- testing: -9223372034707292160 >> -1 --- +int(-1) +--- testing: -9223372034707292160 >> 7 --- +int(-72057594021150720) +--- testing: -9223372034707292160 >> 9 --- +int(-18014398505287680) +--- testing: -9223372034707292160 >> 65 --- +int(-4611686017353646080) +--- testing: -9223372034707292160 >> -44 --- +int(-8796093020160) +--- testing: -9223372034707292160 >> 2147483647 --- +int(-1) +--- testing: -9223372034707292160 >> 9223372036854775807 --- +int(-1) +--- testing: 2147483648 >> 0 --- +int(2147483648) +--- testing: 2147483648 >> 1 --- +int(1073741824) +--- testing: 2147483648 >> -1 --- +int(0) +--- testing: 2147483648 >> 7 --- +int(16777216) +--- testing: 2147483648 >> 9 --- +int(4194304) +--- testing: 2147483648 >> 65 --- +int(1073741824) +--- testing: 2147483648 >> -44 --- +int(2048) +--- testing: 2147483648 >> 2147483647 --- +int(0) +--- testing: 2147483648 >> 9223372036854775807 --- +int(0) +--- testing: -2147483649 >> 0 --- +int(-2147483649) +--- testing: -2147483649 >> 1 --- +int(-1073741825) +--- testing: -2147483649 >> -1 --- +int(-1) +--- testing: -2147483649 >> 7 --- +int(-16777217) +--- testing: -2147483649 >> 9 --- +int(-4194305) +--- testing: -2147483649 >> 65 --- +int(-1073741825) +--- testing: -2147483649 >> -44 --- +int(-2049) +--- testing: -2147483649 >> 2147483647 --- +int(-1) +--- testing: -2147483649 >> 9223372036854775807 --- +int(-1) +--- testing: 4294967294 >> 0 --- +int(4294967294) +--- testing: 4294967294 >> 1 --- +int(2147483647) +--- testing: 4294967294 >> -1 --- +int(0) +--- testing: 4294967294 >> 7 --- +int(33554431) +--- testing: 4294967294 >> 9 --- +int(8388607) +--- testing: 4294967294 >> 65 --- +int(2147483647) +--- testing: 4294967294 >> -44 --- +int(4095) +--- testing: 4294967294 >> 2147483647 --- +int(0) +--- testing: 4294967294 >> 9223372036854775807 --- +int(0) +--- testing: 4294967295 >> 0 --- +int(4294967295) +--- testing: 4294967295 >> 1 --- +int(2147483647) +--- testing: 4294967295 >> -1 --- +int(0) +--- testing: 4294967295 >> 7 --- +int(33554431) +--- testing: 4294967295 >> 9 --- +int(8388607) +--- testing: 4294967295 >> 65 --- +int(2147483647) +--- testing: 4294967295 >> -44 --- +int(4095) +--- testing: 4294967295 >> 2147483647 --- +int(0) +--- testing: 4294967295 >> 9223372036854775807 --- +int(0) +--- testing: 4294967293 >> 0 --- +int(4294967293) +--- testing: 4294967293 >> 1 --- +int(2147483646) +--- testing: 4294967293 >> -1 --- +int(0) +--- testing: 4294967293 >> 7 --- +int(33554431) +--- testing: 4294967293 >> 9 --- +int(8388607) +--- testing: 4294967293 >> 65 --- +int(2147483646) +--- testing: 4294967293 >> -44 --- +int(4095) +--- testing: 4294967293 >> 2147483647 --- +int(0) +--- testing: 4294967293 >> 9223372036854775807 --- +int(0) +--- testing: 9223372036854775806 >> 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 >> 1 --- +int(4611686018427387903) +--- testing: 9223372036854775806 >> -1 --- +int(0) +--- testing: 9223372036854775806 >> 7 --- +int(72057594037927935) +--- testing: 9223372036854775806 >> 9 --- +int(18014398509481983) +--- testing: 9223372036854775806 >> 65 --- +int(4611686018427387903) +--- testing: 9223372036854775806 >> -44 --- +int(8796093022207) +--- testing: 9223372036854775806 >> 2147483647 --- +int(0) +--- testing: 9223372036854775806 >> 9223372036854775807 --- +int(0) +--- testing: 9.2233720368548E+18 >> 0 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 >> 1 --- +int(-4611686018427387904) +--- testing: 9.2233720368548E+18 >> -1 --- +int(-1) +--- testing: 9.2233720368548E+18 >> 7 --- +int(-72057594037927936) +--- testing: 9.2233720368548E+18 >> 9 --- +int(-18014398509481984) +--- testing: 9.2233720368548E+18 >> 65 --- +int(-4611686018427387904) +--- testing: 9.2233720368548E+18 >> -44 --- +int(-8796093022208) +--- testing: 9.2233720368548E+18 >> 2147483647 --- +int(-1) +--- testing: 9.2233720368548E+18 >> 9223372036854775807 --- +int(-1) +--- testing: -9223372036854775807 >> 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 >> 1 --- +int(-4611686018427387904) +--- testing: -9223372036854775807 >> -1 --- +int(-1) +--- testing: -9223372036854775807 >> 7 --- +int(-72057594037927936) +--- testing: -9223372036854775807 >> 9 --- +int(-18014398509481984) +--- testing: -9223372036854775807 >> 65 --- +int(-4611686018427387904) +--- testing: -9223372036854775807 >> -44 --- +int(-8796093022208) +--- testing: -9223372036854775807 >> 2147483647 --- +int(-1) +--- testing: -9223372036854775807 >> 9223372036854775807 --- +int(-1) +--- testing: -9.2233720368548E+18 >> 0 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 >> 1 --- +int(-4611686018427387904) +--- testing: -9.2233720368548E+18 >> -1 --- +int(-1) +--- testing: -9.2233720368548E+18 >> 7 --- +int(-72057594037927936) +--- testing: -9.2233720368548E+18 >> 9 --- +int(-18014398509481984) +--- testing: -9.2233720368548E+18 >> 65 --- +int(-4611686018427387904) +--- testing: -9.2233720368548E+18 >> -44 --- +int(-8796093022208) +--- testing: -9.2233720368548E+18 >> 2147483647 --- +int(-1) +--- testing: -9.2233720368548E+18 >> 9223372036854775807 --- +int(-1) +--- testing: 0 >> 9223372036854775807 --- +int(0) +--- testing: 0 >> -9223372036854775808 --- +int(0) +--- testing: 0 >> 2147483647 --- +int(0) +--- testing: 0 >> -2147483648 --- +int(0) +--- testing: 0 >> 9223372034707292160 --- +int(0) +--- testing: 0 >> -9223372034707292160 --- +int(0) +--- testing: 0 >> 2147483648 --- +int(0) +--- testing: 0 >> -2147483649 --- +int(0) +--- testing: 0 >> 4294967294 --- +int(0) +--- testing: 0 >> 4294967295 --- +int(0) +--- testing: 0 >> 4294967293 --- +int(0) +--- testing: 0 >> 9223372036854775806 --- +int(0) +--- testing: 0 >> 9.2233720368548E+18 --- +int(0) +--- testing: 0 >> -9223372036854775807 --- +int(0) +--- testing: 0 >> -9.2233720368548E+18 --- +int(0) +--- testing: 1 >> 9223372036854775807 --- +int(0) +--- testing: 1 >> -9223372036854775808 --- +int(1) +--- testing: 1 >> 2147483647 --- +int(0) +--- testing: 1 >> -2147483648 --- +int(1) +--- testing: 1 >> 9223372034707292160 --- +int(1) +--- testing: 1 >> -9223372034707292160 --- +int(1) +--- testing: 1 >> 2147483648 --- +int(1) +--- testing: 1 >> -2147483649 --- +int(0) +--- testing: 1 >> 4294967294 --- +int(0) +--- testing: 1 >> 4294967295 --- +int(0) +--- testing: 1 >> 4294967293 --- +int(0) +--- testing: 1 >> 9223372036854775806 --- +int(0) +--- testing: 1 >> 9.2233720368548E+18 --- +int(1) +--- testing: 1 >> -9223372036854775807 --- +int(0) +--- testing: 1 >> -9.2233720368548E+18 --- +int(1) +--- testing: -1 >> 9223372036854775807 --- +int(-1) +--- testing: -1 >> -9223372036854775808 --- +int(-1) +--- testing: -1 >> 2147483647 --- +int(-1) +--- testing: -1 >> -2147483648 --- +int(-1) +--- testing: -1 >> 9223372034707292160 --- +int(-1) +--- testing: -1 >> -9223372034707292160 --- +int(-1) +--- testing: -1 >> 2147483648 --- +int(-1) +--- testing: -1 >> -2147483649 --- +int(-1) +--- testing: -1 >> 4294967294 --- +int(-1) +--- testing: -1 >> 4294967295 --- +int(-1) +--- testing: -1 >> 4294967293 --- +int(-1) +--- testing: -1 >> 9223372036854775806 --- +int(-1) +--- testing: -1 >> 9.2233720368548E+18 --- +int(-1) +--- testing: -1 >> -9223372036854775807 --- +int(-1) +--- testing: -1 >> -9.2233720368548E+18 --- +int(-1) +--- testing: 7 >> 9223372036854775807 --- +int(0) +--- testing: 7 >> -9223372036854775808 --- +int(7) +--- testing: 7 >> 2147483647 --- +int(0) +--- testing: 7 >> -2147483648 --- +int(7) +--- testing: 7 >> 9223372034707292160 --- +int(7) +--- testing: 7 >> -9223372034707292160 --- +int(7) +--- testing: 7 >> 2147483648 --- +int(7) +--- testing: 7 >> -2147483649 --- +int(0) +--- testing: 7 >> 4294967294 --- +int(0) +--- testing: 7 >> 4294967295 --- +int(0) +--- testing: 7 >> 4294967293 --- +int(0) +--- testing: 7 >> 9223372036854775806 --- +int(0) +--- testing: 7 >> 9.2233720368548E+18 --- +int(7) +--- testing: 7 >> -9223372036854775807 --- +int(3) +--- testing: 7 >> -9.2233720368548E+18 --- +int(7) +--- testing: 9 >> 9223372036854775807 --- +int(0) +--- testing: 9 >> -9223372036854775808 --- +int(9) +--- testing: 9 >> 2147483647 --- +int(0) +--- testing: 9 >> -2147483648 --- +int(9) +--- testing: 9 >> 9223372034707292160 --- +int(9) +--- testing: 9 >> -9223372034707292160 --- +int(9) +--- testing: 9 >> 2147483648 --- +int(9) +--- testing: 9 >> -2147483649 --- +int(0) +--- testing: 9 >> 4294967294 --- +int(0) +--- testing: 9 >> 4294967295 --- +int(0) +--- testing: 9 >> 4294967293 --- +int(0) +--- testing: 9 >> 9223372036854775806 --- +int(0) +--- testing: 9 >> 9.2233720368548E+18 --- +int(9) +--- testing: 9 >> -9223372036854775807 --- +int(4) +--- testing: 9 >> -9.2233720368548E+18 --- +int(9) +--- testing: 65 >> 9223372036854775807 --- +int(0) +--- testing: 65 >> -9223372036854775808 --- +int(65) +--- testing: 65 >> 2147483647 --- +int(0) +--- testing: 65 >> -2147483648 --- +int(65) +--- testing: 65 >> 9223372034707292160 --- +int(65) +--- testing: 65 >> -9223372034707292160 --- +int(65) +--- testing: 65 >> 2147483648 --- +int(65) +--- testing: 65 >> -2147483649 --- +int(0) +--- testing: 65 >> 4294967294 --- +int(0) +--- testing: 65 >> 4294967295 --- +int(0) +--- testing: 65 >> 4294967293 --- +int(0) +--- testing: 65 >> 9223372036854775806 --- +int(0) +--- testing: 65 >> 9.2233720368548E+18 --- +int(65) +--- testing: 65 >> -9223372036854775807 --- +int(32) +--- testing: 65 >> -9.2233720368548E+18 --- +int(65) +--- testing: -44 >> 9223372036854775807 --- +int(-1) +--- testing: -44 >> -9223372036854775808 --- +int(-44) +--- testing: -44 >> 2147483647 --- +int(-1) +--- testing: -44 >> -2147483648 --- +int(-44) +--- testing: -44 >> 9223372034707292160 --- +int(-44) +--- testing: -44 >> -9223372034707292160 --- +int(-44) +--- testing: -44 >> 2147483648 --- +int(-44) +--- testing: -44 >> -2147483649 --- +int(-1) +--- testing: -44 >> 4294967294 --- +int(-1) +--- testing: -44 >> 4294967295 --- +int(-1) +--- testing: -44 >> 4294967293 --- +int(-1) +--- testing: -44 >> 9223372036854775806 --- +int(-1) +--- testing: -44 >> 9.2233720368548E+18 --- +int(-44) +--- testing: -44 >> -9223372036854775807 --- +int(-22) +--- testing: -44 >> -9.2233720368548E+18 --- +int(-44) +--- testing: 2147483647 >> 9223372036854775807 --- +int(0) +--- testing: 2147483647 >> -9223372036854775808 --- +int(2147483647) +--- testing: 2147483647 >> 2147483647 --- +int(0) +--- testing: 2147483647 >> -2147483648 --- +int(2147483647) +--- testing: 2147483647 >> 9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 >> -9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 >> 2147483648 --- +int(2147483647) +--- testing: 2147483647 >> -2147483649 --- +int(0) +--- testing: 2147483647 >> 4294967294 --- +int(0) +--- testing: 2147483647 >> 4294967295 --- +int(0) +--- testing: 2147483647 >> 4294967293 --- +int(0) +--- testing: 2147483647 >> 9223372036854775806 --- +int(0) +--- testing: 2147483647 >> 9.2233720368548E+18 --- +int(2147483647) +--- testing: 2147483647 >> -9223372036854775807 --- +int(1073741823) +--- testing: 2147483647 >> -9.2233720368548E+18 --- +int(2147483647) +--- testing: 9223372036854775807 >> 9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 >> -9223372036854775808 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> 2147483647 --- +int(0) +--- testing: 9223372036854775807 >> -2147483648 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> 9223372034707292160 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> -9223372034707292160 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> 2147483648 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> -2147483649 --- +int(0) +--- testing: 9223372036854775807 >> 4294967294 --- +int(1) +--- testing: 9223372036854775807 >> 4294967295 --- +int(0) +--- testing: 9223372036854775807 >> 4294967293 --- +int(3) +--- testing: 9223372036854775807 >> 9223372036854775806 --- +int(1) +--- testing: 9223372036854775807 >> 9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: 9223372036854775807 >> -9223372036854775807 --- +int(4611686018427387903) +--- testing: 9223372036854775807 >> -9.2233720368548E+18 --- +int(9223372036854775807) +===DONE=== + \ No newline at end of file diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt new file mode 100644 index 0000000..9518d42 --- /dev/null +++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test >> operator : various numbers as strings +--FILE-- +> '$otherVal' ---\n"; + var_dump(bin2hex($strVal>>$otherVal)); + } +} + + +?> +===DONE=== +--EXPECT-- +--- testing: '0' >> '0' --- +string(2) "30" +--- testing: '0' >> '65' --- +string(2) "30" +--- testing: '0' >> '-44' --- +string(2) "30" +--- testing: '0' >> '1.2' --- +string(2) "30" +--- testing: '0' >> '-7.7' --- +string(2) "30" +--- testing: '0' >> 'abc' --- +string(2) "30" +--- testing: '0' >> '123abc' --- +string(2) "30" +--- testing: '0' >> '123e5' --- +string(2) "30" +--- testing: '0' >> '123e5xyz' --- +string(2) "30" +--- testing: '0' >> ' 123abc' --- +string(2) "30" +--- testing: '0' >> '123 abc' --- +string(2) "30" +--- testing: '0' >> '123abc ' --- +string(2) "30" +--- testing: '0' >> '3.4a' --- +string(2) "30" +--- testing: '0' >> 'a5.9' --- +string(2) "30" +--- testing: '65' >> '0' --- +string(4) "3635" +--- testing: '65' >> '65' --- +string(4) "3332" +--- testing: '65' >> '-44' --- +string(2) "30" +--- testing: '65' >> '1.2' --- +string(4) "3332" +--- testing: '65' >> '-7.7' --- +string(2) "30" +--- testing: '65' >> 'abc' --- +string(4) "3635" +--- testing: '65' >> '123abc' --- +string(2) "30" +--- testing: '65' >> '123e5' --- +string(2) "30" +--- testing: '65' >> '123e5xyz' --- +string(2) "30" +--- testing: '65' >> ' 123abc' --- +string(2) "30" +--- testing: '65' >> '123 abc' --- +string(2) "30" +--- testing: '65' >> '123abc ' --- +string(2) "30" +--- testing: '65' >> '3.4a' --- +string(2) "38" +--- testing: '65' >> 'a5.9' --- +string(4) "3635" +--- testing: '-44' >> '0' --- +string(6) "2d3434" +--- testing: '-44' >> '65' --- +string(6) "2d3232" +--- testing: '-44' >> '-44' --- +string(4) "2d31" +--- testing: '-44' >> '1.2' --- +string(6) "2d3232" +--- testing: '-44' >> '-7.7' --- +string(4) "2d31" +--- testing: '-44' >> 'abc' --- +string(6) "2d3434" +--- testing: '-44' >> '123abc' --- +string(4) "2d31" +--- testing: '-44' >> '123e5' --- +string(4) "2d31" +--- testing: '-44' >> '123e5xyz' --- +string(4) "2d31" +--- testing: '-44' >> ' 123abc' --- +string(4) "2d31" +--- testing: '-44' >> '123 abc' --- +string(4) "2d31" +--- testing: '-44' >> '123abc ' --- +string(4) "2d31" +--- testing: '-44' >> '3.4a' --- +string(4) "2d36" +--- testing: '-44' >> 'a5.9' --- +string(6) "2d3434" +--- testing: '1.2' >> '0' --- +string(2) "31" +--- testing: '1.2' >> '65' --- +string(2) "30" +--- testing: '1.2' >> '-44' --- +string(2) "30" +--- testing: '1.2' >> '1.2' --- +string(2) "30" +--- testing: '1.2' >> '-7.7' --- +string(2) "30" +--- testing: '1.2' >> 'abc' --- +string(2) "31" +--- testing: '1.2' >> '123abc' --- +string(2) "30" +--- testing: '1.2' >> '123e5' --- +string(2) "30" +--- testing: '1.2' >> '123e5xyz' --- +string(2) "30" +--- testing: '1.2' >> ' 123abc' --- +string(2) "30" +--- testing: '1.2' >> '123 abc' --- +string(2) "30" +--- testing: '1.2' >> '123abc ' --- +string(2) "30" +--- testing: '1.2' >> '3.4a' --- +string(2) "30" +--- testing: '1.2' >> 'a5.9' --- +string(2) "31" +--- testing: '-7.7' >> '0' --- +string(4) "2d37" +--- testing: '-7.7' >> '65' --- +string(4) "2d34" +--- testing: '-7.7' >> '-44' --- +string(4) "2d31" +--- testing: '-7.7' >> '1.2' --- +string(4) "2d34" +--- testing: '-7.7' >> '-7.7' --- +string(4) "2d31" +--- testing: '-7.7' >> 'abc' --- +string(4) "2d37" +--- testing: '-7.7' >> '123abc' --- +string(4) "2d31" +--- testing: '-7.7' >> '123e5' --- +string(4) "2d31" +--- testing: '-7.7' >> '123e5xyz' --- +string(4) "2d31" +--- testing: '-7.7' >> ' 123abc' --- +string(4) "2d31" +--- testing: '-7.7' >> '123 abc' --- +string(4) "2d31" +--- testing: '-7.7' >> '123abc ' --- +string(4) "2d31" +--- testing: '-7.7' >> '3.4a' --- +string(4) "2d31" +--- testing: '-7.7' >> 'a5.9' --- +string(4) "2d37" +--- testing: 'abc' >> '0' --- +string(2) "30" +--- testing: 'abc' >> '65' --- +string(2) "30" +--- testing: 'abc' >> '-44' --- +string(2) "30" +--- testing: 'abc' >> '1.2' --- +string(2) "30" +--- testing: 'abc' >> '-7.7' --- +string(2) "30" +--- testing: 'abc' >> 'abc' --- +string(2) "30" +--- testing: 'abc' >> '123abc' --- +string(2) "30" +--- testing: 'abc' >> '123e5' --- +string(2) "30" +--- testing: 'abc' >> '123e5xyz' --- +string(2) "30" +--- testing: 'abc' >> ' 123abc' --- +string(2) "30" +--- testing: 'abc' >> '123 abc' --- +string(2) "30" +--- testing: 'abc' >> '123abc ' --- +string(2) "30" +--- testing: 'abc' >> '3.4a' --- +string(2) "30" +--- testing: 'abc' >> 'a5.9' --- +string(2) "30" +--- testing: '123abc' >> '0' --- +string(6) "313233" +--- testing: '123abc' >> '65' --- +string(4) "3631" +--- testing: '123abc' >> '-44' --- +string(2) "30" +--- testing: '123abc' >> '1.2' --- +string(4) "3631" +--- testing: '123abc' >> '-7.7' --- +string(2) "30" +--- testing: '123abc' >> 'abc' --- +string(6) "313233" +--- testing: '123abc' >> '123abc' --- +string(2) "30" +--- testing: '123abc' >> '123e5' --- +string(2) "30" +--- testing: '123abc' >> '123e5xyz' --- +string(2) "30" +--- testing: '123abc' >> ' 123abc' --- +string(2) "30" +--- testing: '123abc' >> '123 abc' --- +string(2) "30" +--- testing: '123abc' >> '123abc ' --- +string(2) "30" +--- testing: '123abc' >> '3.4a' --- +string(4) "3135" +--- testing: '123abc' >> 'a5.9' --- +string(6) "313233" +--- testing: '123e5' >> '0' --- +string(6) "313233" +--- testing: '123e5' >> '65' --- +string(4) "3631" +--- testing: '123e5' >> '-44' --- +string(2) "30" +--- testing: '123e5' >> '1.2' --- +string(4) "3631" +--- testing: '123e5' >> '-7.7' --- +string(2) "30" +--- testing: '123e5' >> 'abc' --- +string(6) "313233" +--- testing: '123e5' >> '123abc' --- +string(2) "30" +--- testing: '123e5' >> '123e5' --- +string(2) "30" +--- testing: '123e5' >> '123e5xyz' --- +string(2) "30" +--- testing: '123e5' >> ' 123abc' --- +string(2) "30" +--- testing: '123e5' >> '123 abc' --- +string(2) "30" +--- testing: '123e5' >> '123abc ' --- +string(2) "30" +--- testing: '123e5' >> '3.4a' --- +string(4) "3135" +--- testing: '123e5' >> 'a5.9' --- +string(6) "313233" +--- testing: '123e5xyz' >> '0' --- +string(6) "313233" +--- testing: '123e5xyz' >> '65' --- +string(4) "3631" +--- testing: '123e5xyz' >> '-44' --- +string(2) "30" +--- testing: '123e5xyz' >> '1.2' --- +string(4) "3631" +--- testing: '123e5xyz' >> '-7.7' --- +string(2) "30" +--- testing: '123e5xyz' >> 'abc' --- +string(6) "313233" +--- testing: '123e5xyz' >> '123abc' --- +string(2) "30" +--- testing: '123e5xyz' >> '123e5' --- +string(2) "30" +--- testing: '123e5xyz' >> '123e5xyz' --- +string(2) "30" +--- testing: '123e5xyz' >> ' 123abc' --- +string(2) "30" +--- testing: '123e5xyz' >> '123 abc' --- +string(2) "30" +--- testing: '123e5xyz' >> '123abc ' --- +string(2) "30" +--- testing: '123e5xyz' >> '3.4a' --- +string(4) "3135" +--- testing: '123e5xyz' >> 'a5.9' --- +string(6) "313233" +--- testing: ' 123abc' >> '0' --- +string(6) "313233" +--- testing: ' 123abc' >> '65' --- +string(4) "3631" +--- testing: ' 123abc' >> '-44' --- +string(2) "30" +--- testing: ' 123abc' >> '1.2' --- +string(4) "3631" +--- testing: ' 123abc' >> '-7.7' --- +string(2) "30" +--- testing: ' 123abc' >> 'abc' --- +string(6) "313233" +--- testing: ' 123abc' >> '123abc' --- +string(2) "30" +--- testing: ' 123abc' >> '123e5' --- +string(2) "30" +--- testing: ' 123abc' >> '123e5xyz' --- +string(2) "30" +--- testing: ' 123abc' >> ' 123abc' --- +string(2) "30" +--- testing: ' 123abc' >> '123 abc' --- +string(2) "30" +--- testing: ' 123abc' >> '123abc ' --- +string(2) "30" +--- testing: ' 123abc' >> '3.4a' --- +string(4) "3135" +--- testing: ' 123abc' >> 'a5.9' --- +string(6) "313233" +--- testing: '123 abc' >> '0' --- +string(6) "313233" +--- testing: '123 abc' >> '65' --- +string(4) "3631" +--- testing: '123 abc' >> '-44' --- +string(2) "30" +--- testing: '123 abc' >> '1.2' --- +string(4) "3631" +--- testing: '123 abc' >> '-7.7' --- +string(2) "30" +--- testing: '123 abc' >> 'abc' --- +string(6) "313233" +--- testing: '123 abc' >> '123abc' --- +string(2) "30" +--- testing: '123 abc' >> '123e5' --- +string(2) "30" +--- testing: '123 abc' >> '123e5xyz' --- +string(2) "30" +--- testing: '123 abc' >> ' 123abc' --- +string(2) "30" +--- testing: '123 abc' >> '123 abc' --- +string(2) "30" +--- testing: '123 abc' >> '123abc ' --- +string(2) "30" +--- testing: '123 abc' >> '3.4a' --- +string(4) "3135" +--- testing: '123 abc' >> 'a5.9' --- +string(6) "313233" +--- testing: '123abc ' >> '0' --- +string(6) "313233" +--- testing: '123abc ' >> '65' --- +string(4) "3631" +--- testing: '123abc ' >> '-44' --- +string(2) "30" +--- testing: '123abc ' >> '1.2' --- +string(4) "3631" +--- testing: '123abc ' >> '-7.7' --- +string(2) "30" +--- testing: '123abc ' >> 'abc' --- +string(6) "313233" +--- testing: '123abc ' >> '123abc' --- +string(2) "30" +--- testing: '123abc ' >> '123e5' --- +string(2) "30" +--- testing: '123abc ' >> '123e5xyz' --- +string(2) "30" +--- testing: '123abc ' >> ' 123abc' --- +string(2) "30" +--- testing: '123abc ' >> '123 abc' --- +string(2) "30" +--- testing: '123abc ' >> '123abc ' --- +string(2) "30" +--- testing: '123abc ' >> '3.4a' --- +string(4) "3135" +--- testing: '123abc ' >> 'a5.9' --- +string(6) "313233" +--- testing: '3.4a' >> '0' --- +string(2) "33" +--- testing: '3.4a' >> '65' --- +string(2) "31" +--- testing: '3.4a' >> '-44' --- +string(2) "30" +--- testing: '3.4a' >> '1.2' --- +string(2) "31" +--- testing: '3.4a' >> '-7.7' --- +string(2) "30" +--- testing: '3.4a' >> 'abc' --- +string(2) "33" +--- testing: '3.4a' >> '123abc' --- +string(2) "30" +--- testing: '3.4a' >> '123e5' --- +string(2) "30" +--- testing: '3.4a' >> '123e5xyz' --- +string(2) "30" +--- testing: '3.4a' >> ' 123abc' --- +string(2) "30" +--- testing: '3.4a' >> '123 abc' --- +string(2) "30" +--- testing: '3.4a' >> '123abc ' --- +string(2) "30" +--- testing: '3.4a' >> '3.4a' --- +string(2) "30" +--- testing: '3.4a' >> 'a5.9' --- +string(2) "33" +--- testing: 'a5.9' >> '0' --- +string(2) "30" +--- testing: 'a5.9' >> '65' --- +string(2) "30" +--- testing: 'a5.9' >> '-44' --- +string(2) "30" +--- testing: 'a5.9' >> '1.2' --- +string(2) "30" +--- testing: 'a5.9' >> '-7.7' --- +string(2) "30" +--- testing: 'a5.9' >> 'abc' --- +string(2) "30" +--- testing: 'a5.9' >> '123abc' --- +string(2) "30" +--- testing: 'a5.9' >> '123e5' --- +string(2) "30" +--- testing: 'a5.9' >> '123e5xyz' --- +string(2) "30" +--- testing: 'a5.9' >> ' 123abc' --- +string(2) "30" +--- testing: 'a5.9' >> '123 abc' --- +string(2) "30" +--- testing: 'a5.9' >> '123abc ' --- +string(2) "30" +--- testing: 'a5.9' >> '3.4a' --- +string(2) "30" +--- testing: 'a5.9' >> 'a5.9' --- +string(2) "30" +===DONE=== diff --git a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt new file mode 100644 index 0000000..2764be6 --- /dev/null +++ b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt @@ -0,0 +1,583 @@ +--TEST-- +Test ^ operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 ^ 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 ^ 1 --- +int(9223372036854775806) +--- testing: 9223372036854775807 ^ -1 --- +int(-9223372036854775808) +--- testing: 9223372036854775807 ^ 7 --- +int(9223372036854775800) +--- testing: 9223372036854775807 ^ 9 --- +int(9223372036854775798) +--- testing: 9223372036854775807 ^ 65 --- +int(9223372036854775742) +--- testing: 9223372036854775807 ^ -44 --- +int(-9223372036854775765) +--- testing: 9223372036854775807 ^ 2147483647 --- +int(9223372034707292160) +--- testing: 9223372036854775807 ^ 9223372036854775807 --- +int(0) +--- testing: -9223372036854775808 ^ 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 ^ 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775808 ^ -1 --- +int(9223372036854775807) +--- testing: -9223372036854775808 ^ 7 --- +int(-9223372036854775801) +--- testing: -9223372036854775808 ^ 9 --- +int(-9223372036854775799) +--- testing: -9223372036854775808 ^ 65 --- +int(-9223372036854775743) +--- testing: -9223372036854775808 ^ -44 --- +int(9223372036854775764) +--- testing: -9223372036854775808 ^ 2147483647 --- +int(-9223372034707292161) +--- testing: -9223372036854775808 ^ 9223372036854775807 --- +int(-1) +--- testing: 2147483647 ^ 0 --- +int(2147483647) +--- testing: 2147483647 ^ 1 --- +int(2147483646) +--- testing: 2147483647 ^ -1 --- +int(-2147483648) +--- testing: 2147483647 ^ 7 --- +int(2147483640) +--- testing: 2147483647 ^ 9 --- +int(2147483638) +--- testing: 2147483647 ^ 65 --- +int(2147483582) +--- testing: 2147483647 ^ -44 --- +int(-2147483605) +--- testing: 2147483647 ^ 2147483647 --- +int(0) +--- testing: 2147483647 ^ 9223372036854775807 --- +int(9223372034707292160) +--- testing: -2147483648 ^ 0 --- +int(-2147483648) +--- testing: -2147483648 ^ 1 --- +int(-2147483647) +--- testing: -2147483648 ^ -1 --- +int(2147483647) +--- testing: -2147483648 ^ 7 --- +int(-2147483641) +--- testing: -2147483648 ^ 9 --- +int(-2147483639) +--- testing: -2147483648 ^ 65 --- +int(-2147483583) +--- testing: -2147483648 ^ -44 --- +int(2147483604) +--- testing: -2147483648 ^ 2147483647 --- +int(-1) +--- testing: -2147483648 ^ 9223372036854775807 --- +int(-9223372034707292161) +--- testing: 9223372034707292160 ^ 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 ^ 1 --- +int(9223372034707292161) +--- testing: 9223372034707292160 ^ -1 --- +int(-9223372034707292161) +--- testing: 9223372034707292160 ^ 7 --- +int(9223372034707292167) +--- testing: 9223372034707292160 ^ 9 --- +int(9223372034707292169) +--- testing: 9223372034707292160 ^ 65 --- +int(9223372034707292225) +--- testing: 9223372034707292160 ^ -44 --- +int(-9223372034707292204) +--- testing: 9223372034707292160 ^ 2147483647 --- +int(9223372036854775807) +--- testing: 9223372034707292160 ^ 9223372036854775807 --- +int(2147483647) +--- testing: -9223372034707292160 ^ 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 ^ 1 --- +int(-9223372034707292159) +--- testing: -9223372034707292160 ^ -1 --- +int(9223372034707292159) +--- testing: -9223372034707292160 ^ 7 --- +int(-9223372034707292153) +--- testing: -9223372034707292160 ^ 9 --- +int(-9223372034707292151) +--- testing: -9223372034707292160 ^ 65 --- +int(-9223372034707292095) +--- testing: -9223372034707292160 ^ -44 --- +int(9223372034707292116) +--- testing: -9223372034707292160 ^ 2147483647 --- +int(-9223372032559808513) +--- testing: -9223372034707292160 ^ 9223372036854775807 --- +int(-2147483649) +--- testing: 2147483648 ^ 0 --- +int(2147483648) +--- testing: 2147483648 ^ 1 --- +int(2147483649) +--- testing: 2147483648 ^ -1 --- +int(-2147483649) +--- testing: 2147483648 ^ 7 --- +int(2147483655) +--- testing: 2147483648 ^ 9 --- +int(2147483657) +--- testing: 2147483648 ^ 65 --- +int(2147483713) +--- testing: 2147483648 ^ -44 --- +int(-2147483692) +--- testing: 2147483648 ^ 2147483647 --- +int(4294967295) +--- testing: 2147483648 ^ 9223372036854775807 --- +int(9223372034707292159) +--- testing: -2147483649 ^ 0 --- +int(-2147483649) +--- testing: -2147483649 ^ 1 --- +int(-2147483650) +--- testing: -2147483649 ^ -1 --- +int(2147483648) +--- testing: -2147483649 ^ 7 --- +int(-2147483656) +--- testing: -2147483649 ^ 9 --- +int(-2147483658) +--- testing: -2147483649 ^ 65 --- +int(-2147483714) +--- testing: -2147483649 ^ -44 --- +int(2147483691) +--- testing: -2147483649 ^ 2147483647 --- +int(-4294967296) +--- testing: -2147483649 ^ 9223372036854775807 --- +int(-9223372034707292160) +--- testing: 4294967294 ^ 0 --- +int(4294967294) +--- testing: 4294967294 ^ 1 --- +int(4294967295) +--- testing: 4294967294 ^ -1 --- +int(-4294967295) +--- testing: 4294967294 ^ 7 --- +int(4294967289) +--- testing: 4294967294 ^ 9 --- +int(4294967287) +--- testing: 4294967294 ^ 65 --- +int(4294967231) +--- testing: 4294967294 ^ -44 --- +int(-4294967254) +--- testing: 4294967294 ^ 2147483647 --- +int(2147483649) +--- testing: 4294967294 ^ 9223372036854775807 --- +int(9223372032559808513) +--- testing: 4294967295 ^ 0 --- +int(4294967295) +--- testing: 4294967295 ^ 1 --- +int(4294967294) +--- testing: 4294967295 ^ -1 --- +int(-4294967296) +--- testing: 4294967295 ^ 7 --- +int(4294967288) +--- testing: 4294967295 ^ 9 --- +int(4294967286) +--- testing: 4294967295 ^ 65 --- +int(4294967230) +--- testing: 4294967295 ^ -44 --- +int(-4294967253) +--- testing: 4294967295 ^ 2147483647 --- +int(2147483648) +--- testing: 4294967295 ^ 9223372036854775807 --- +int(9223372032559808512) +--- testing: 4294967293 ^ 0 --- +int(4294967293) +--- testing: 4294967293 ^ 1 --- +int(4294967292) +--- testing: 4294967293 ^ -1 --- +int(-4294967294) +--- testing: 4294967293 ^ 7 --- +int(4294967290) +--- testing: 4294967293 ^ 9 --- +int(4294967284) +--- testing: 4294967293 ^ 65 --- +int(4294967228) +--- testing: 4294967293 ^ -44 --- +int(-4294967255) +--- testing: 4294967293 ^ 2147483647 --- +int(2147483650) +--- testing: 4294967293 ^ 9223372036854775807 --- +int(9223372032559808514) +--- testing: 9223372036854775806 ^ 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 ^ 1 --- +int(9223372036854775807) +--- testing: 9223372036854775806 ^ -1 --- +int(-9223372036854775807) +--- testing: 9223372036854775806 ^ 7 --- +int(9223372036854775801) +--- testing: 9223372036854775806 ^ 9 --- +int(9223372036854775799) +--- testing: 9223372036854775806 ^ 65 --- +int(9223372036854775743) +--- testing: 9223372036854775806 ^ -44 --- +int(-9223372036854775766) +--- testing: 9223372036854775806 ^ 2147483647 --- +int(9223372034707292161) +--- testing: 9223372036854775806 ^ 9223372036854775807 --- +int(1) +--- testing: 9.2233720368548E+18 ^ 0 --- +int(-9223372036854775808) +--- testing: 9.2233720368548E+18 ^ 1 --- +int(-9223372036854775807) +--- testing: 9.2233720368548E+18 ^ -1 --- +int(9223372036854775807) +--- testing: 9.2233720368548E+18 ^ 7 --- +int(-9223372036854775801) +--- testing: 9.2233720368548E+18 ^ 9 --- +int(-9223372036854775799) +--- testing: 9.2233720368548E+18 ^ 65 --- +int(-9223372036854775743) +--- testing: 9.2233720368548E+18 ^ -44 --- +int(9223372036854775764) +--- testing: 9.2233720368548E+18 ^ 2147483647 --- +int(-9223372034707292161) +--- testing: 9.2233720368548E+18 ^ 9223372036854775807 --- +int(-1) +--- testing: -9223372036854775807 ^ 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 ^ 1 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 ^ -1 --- +int(9223372036854775806) +--- testing: -9223372036854775807 ^ 7 --- +int(-9223372036854775802) +--- testing: -9223372036854775807 ^ 9 --- +int(-9223372036854775800) +--- testing: -9223372036854775807 ^ 65 --- +int(-9223372036854775744) +--- testing: -9223372036854775807 ^ -44 --- +int(9223372036854775765) +--- testing: -9223372036854775807 ^ 2147483647 --- +int(-9223372034707292162) +--- testing: -9223372036854775807 ^ 9223372036854775807 --- +int(-2) +--- testing: -9.2233720368548E+18 ^ 0 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 ^ 1 --- +int(-9223372036854775807) +--- testing: -9.2233720368548E+18 ^ -1 --- +int(9223372036854775807) +--- testing: -9.2233720368548E+18 ^ 7 --- +int(-9223372036854775801) +--- testing: -9.2233720368548E+18 ^ 9 --- +int(-9223372036854775799) +--- testing: -9.2233720368548E+18 ^ 65 --- +int(-9223372036854775743) +--- testing: -9.2233720368548E+18 ^ -44 --- +int(9223372036854775764) +--- testing: -9.2233720368548E+18 ^ 2147483647 --- +int(-9223372034707292161) +--- testing: -9.2233720368548E+18 ^ 9223372036854775807 --- +int(-1) +--- testing: 0 ^ 9223372036854775807 --- +int(9223372036854775807) +--- testing: 0 ^ -9223372036854775808 --- +int(-9223372036854775808) +--- testing: 0 ^ 2147483647 --- +int(2147483647) +--- testing: 0 ^ -2147483648 --- +int(-2147483648) +--- testing: 0 ^ 9223372034707292160 --- +int(9223372034707292160) +--- testing: 0 ^ -9223372034707292160 --- +int(-9223372034707292160) +--- testing: 0 ^ 2147483648 --- +int(2147483648) +--- testing: 0 ^ -2147483649 --- +int(-2147483649) +--- testing: 0 ^ 4294967294 --- +int(4294967294) +--- testing: 0 ^ 4294967295 --- +int(4294967295) +--- testing: 0 ^ 4294967293 --- +int(4294967293) +--- testing: 0 ^ 9223372036854775806 --- +int(9223372036854775806) +--- testing: 0 ^ 9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 0 ^ -9223372036854775807 --- +int(-9223372036854775807) +--- testing: 0 ^ -9.2233720368548E+18 --- +int(-9223372036854775808) +--- testing: 1 ^ 9223372036854775807 --- +int(9223372036854775806) +--- testing: 1 ^ -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 1 ^ 2147483647 --- +int(2147483646) +--- testing: 1 ^ -2147483648 --- +int(-2147483647) +--- testing: 1 ^ 9223372034707292160 --- +int(9223372034707292161) +--- testing: 1 ^ -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 1 ^ 2147483648 --- +int(2147483649) +--- testing: 1 ^ -2147483649 --- +int(-2147483650) +--- testing: 1 ^ 4294967294 --- +int(4294967295) +--- testing: 1 ^ 4294967295 --- +int(4294967294) +--- testing: 1 ^ 4294967293 --- +int(4294967292) +--- testing: 1 ^ 9223372036854775806 --- +int(9223372036854775807) +--- testing: 1 ^ 9.2233720368548E+18 --- +int(-9223372036854775807) +--- testing: 1 ^ -9223372036854775807 --- +int(-9223372036854775808) +--- testing: 1 ^ -9.2233720368548E+18 --- +int(-9223372036854775807) +--- testing: -1 ^ 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -1 ^ -9223372036854775808 --- +int(9223372036854775807) +--- testing: -1 ^ 2147483647 --- +int(-2147483648) +--- testing: -1 ^ -2147483648 --- +int(2147483647) +--- testing: -1 ^ 9223372034707292160 --- +int(-9223372034707292161) +--- testing: -1 ^ -9223372034707292160 --- +int(9223372034707292159) +--- testing: -1 ^ 2147483648 --- +int(-2147483649) +--- testing: -1 ^ -2147483649 --- +int(2147483648) +--- testing: -1 ^ 4294967294 --- +int(-4294967295) +--- testing: -1 ^ 4294967295 --- +int(-4294967296) +--- testing: -1 ^ 4294967293 --- +int(-4294967294) +--- testing: -1 ^ 9223372036854775806 --- +int(-9223372036854775807) +--- testing: -1 ^ 9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: -1 ^ -9223372036854775807 --- +int(9223372036854775806) +--- testing: -1 ^ -9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: 7 ^ 9223372036854775807 --- +int(9223372036854775800) +--- testing: 7 ^ -9223372036854775808 --- +int(-9223372036854775801) +--- testing: 7 ^ 2147483647 --- +int(2147483640) +--- testing: 7 ^ -2147483648 --- +int(-2147483641) +--- testing: 7 ^ 9223372034707292160 --- +int(9223372034707292167) +--- testing: 7 ^ -9223372034707292160 --- +int(-9223372034707292153) +--- testing: 7 ^ 2147483648 --- +int(2147483655) +--- testing: 7 ^ -2147483649 --- +int(-2147483656) +--- testing: 7 ^ 4294967294 --- +int(4294967289) +--- testing: 7 ^ 4294967295 --- +int(4294967288) +--- testing: 7 ^ 4294967293 --- +int(4294967290) +--- testing: 7 ^ 9223372036854775806 --- +int(9223372036854775801) +--- testing: 7 ^ 9.2233720368548E+18 --- +int(-9223372036854775801) +--- testing: 7 ^ -9223372036854775807 --- +int(-9223372036854775802) +--- testing: 7 ^ -9.2233720368548E+18 --- +int(-9223372036854775801) +--- testing: 9 ^ 9223372036854775807 --- +int(9223372036854775798) +--- testing: 9 ^ -9223372036854775808 --- +int(-9223372036854775799) +--- testing: 9 ^ 2147483647 --- +int(2147483638) +--- testing: 9 ^ -2147483648 --- +int(-2147483639) +--- testing: 9 ^ 9223372034707292160 --- +int(9223372034707292169) +--- testing: 9 ^ -9223372034707292160 --- +int(-9223372034707292151) +--- testing: 9 ^ 2147483648 --- +int(2147483657) +--- testing: 9 ^ -2147483649 --- +int(-2147483658) +--- testing: 9 ^ 4294967294 --- +int(4294967287) +--- testing: 9 ^ 4294967295 --- +int(4294967286) +--- testing: 9 ^ 4294967293 --- +int(4294967284) +--- testing: 9 ^ 9223372036854775806 --- +int(9223372036854775799) +--- testing: 9 ^ 9.2233720368548E+18 --- +int(-9223372036854775799) +--- testing: 9 ^ -9223372036854775807 --- +int(-9223372036854775800) +--- testing: 9 ^ -9.2233720368548E+18 --- +int(-9223372036854775799) +--- testing: 65 ^ 9223372036854775807 --- +int(9223372036854775742) +--- testing: 65 ^ -9223372036854775808 --- +int(-9223372036854775743) +--- testing: 65 ^ 2147483647 --- +int(2147483582) +--- testing: 65 ^ -2147483648 --- +int(-2147483583) +--- testing: 65 ^ 9223372034707292160 --- +int(9223372034707292225) +--- testing: 65 ^ -9223372034707292160 --- +int(-9223372034707292095) +--- testing: 65 ^ 2147483648 --- +int(2147483713) +--- testing: 65 ^ -2147483649 --- +int(-2147483714) +--- testing: 65 ^ 4294967294 --- +int(4294967231) +--- testing: 65 ^ 4294967295 --- +int(4294967230) +--- testing: 65 ^ 4294967293 --- +int(4294967228) +--- testing: 65 ^ 9223372036854775806 --- +int(9223372036854775743) +--- testing: 65 ^ 9.2233720368548E+18 --- +int(-9223372036854775743) +--- testing: 65 ^ -9223372036854775807 --- +int(-9223372036854775744) +--- testing: 65 ^ -9.2233720368548E+18 --- +int(-9223372036854775743) +--- testing: -44 ^ 9223372036854775807 --- +int(-9223372036854775765) +--- testing: -44 ^ -9223372036854775808 --- +int(9223372036854775764) +--- testing: -44 ^ 2147483647 --- +int(-2147483605) +--- testing: -44 ^ -2147483648 --- +int(2147483604) +--- testing: -44 ^ 9223372034707292160 --- +int(-9223372034707292204) +--- testing: -44 ^ -9223372034707292160 --- +int(9223372034707292116) +--- testing: -44 ^ 2147483648 --- +int(-2147483692) +--- testing: -44 ^ -2147483649 --- +int(2147483691) +--- testing: -44 ^ 4294967294 --- +int(-4294967254) +--- testing: -44 ^ 4294967295 --- +int(-4294967253) +--- testing: -44 ^ 4294967293 --- +int(-4294967255) +--- testing: -44 ^ 9223372036854775806 --- +int(-9223372036854775766) +--- testing: -44 ^ 9.2233720368548E+18 --- +int(9223372036854775764) +--- testing: -44 ^ -9223372036854775807 --- +int(9223372036854775765) +--- testing: -44 ^ -9.2233720368548E+18 --- +int(9223372036854775764) +--- testing: 2147483647 ^ 9223372036854775807 --- +int(9223372034707292160) +--- testing: 2147483647 ^ -9223372036854775808 --- +int(-9223372034707292161) +--- testing: 2147483647 ^ 2147483647 --- +int(0) +--- testing: 2147483647 ^ -2147483648 --- +int(-1) +--- testing: 2147483647 ^ 9223372034707292160 --- +int(9223372036854775807) +--- testing: 2147483647 ^ -9223372034707292160 --- +int(-9223372032559808513) +--- testing: 2147483647 ^ 2147483648 --- +int(4294967295) +--- testing: 2147483647 ^ -2147483649 --- +int(-4294967296) +--- testing: 2147483647 ^ 4294967294 --- +int(2147483649) +--- testing: 2147483647 ^ 4294967295 --- +int(2147483648) +--- testing: 2147483647 ^ 4294967293 --- +int(2147483650) +--- testing: 2147483647 ^ 9223372036854775806 --- +int(9223372034707292161) +--- testing: 2147483647 ^ 9.2233720368548E+18 --- +int(-9223372034707292161) +--- testing: 2147483647 ^ -9223372036854775807 --- +int(-9223372034707292162) +--- testing: 2147483647 ^ -9.2233720368548E+18 --- +int(-9223372034707292161) +--- testing: 9223372036854775807 ^ 9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 ^ -9223372036854775808 --- +int(-1) +--- testing: 9223372036854775807 ^ 2147483647 --- +int(9223372034707292160) +--- testing: 9223372036854775807 ^ -2147483648 --- +int(-9223372034707292161) +--- testing: 9223372036854775807 ^ 9223372034707292160 --- +int(2147483647) +--- testing: 9223372036854775807 ^ -9223372034707292160 --- +int(-2147483649) +--- testing: 9223372036854775807 ^ 2147483648 --- +int(9223372034707292159) +--- testing: 9223372036854775807 ^ -2147483649 --- +int(-9223372034707292160) +--- testing: 9223372036854775807 ^ 4294967294 --- +int(9223372032559808513) +--- testing: 9223372036854775807 ^ 4294967295 --- +int(9223372032559808512) +--- testing: 9223372036854775807 ^ 4294967293 --- +int(9223372032559808514) +--- testing: 9223372036854775807 ^ 9223372036854775806 --- +int(1) +--- testing: 9223372036854775807 ^ 9.2233720368548E+18 --- +int(-1) +--- testing: 9223372036854775807 ^ -9223372036854775807 --- +int(-2) +--- testing: 9223372036854775807 ^ -9.2233720368548E+18 --- +int(-1) +===DONE=== + \ No newline at end of file diff --git a/tests/lang/operators/bitwiseXor_variationStr.phpt b/tests/lang/operators/bitwiseXor_variationStr.phpt new file mode 100644 index 0000000..7dda659 --- /dev/null +++ b/tests/lang/operators/bitwiseXor_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test ^ operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' ^ '0' --- +string(2) "00" +--- testing: '0' ^ '65' --- +string(2) "06" +--- testing: '0' ^ '-44' --- +string(2) "1d" +--- testing: '0' ^ '1.2' --- +string(2) "01" +--- testing: '0' ^ '-7.7' --- +string(2) "1d" +--- testing: '0' ^ 'abc' --- +string(2) "51" +--- testing: '0' ^ '123abc' --- +string(2) "01" +--- testing: '0' ^ '123e5' --- +string(2) "01" +--- testing: '0' ^ '123e5xyz' --- +string(2) "01" +--- testing: '0' ^ ' 123abc' --- +string(2) "10" +--- testing: '0' ^ '123 abc' --- +string(2) "01" +--- testing: '0' ^ '123abc ' --- +string(2) "01" +--- testing: '0' ^ '3.4a' --- +string(2) "03" +--- testing: '0' ^ 'a5.9' --- +string(2) "51" +--- testing: '65' ^ '0' --- +string(2) "06" +--- testing: '65' ^ '65' --- +string(4) "0000" +--- testing: '65' ^ '-44' --- +string(4) "1b01" +--- testing: '65' ^ '1.2' --- +string(4) "071b" +--- testing: '65' ^ '-7.7' --- +string(4) "1b02" +--- testing: '65' ^ 'abc' --- +string(4) "5757" +--- testing: '65' ^ '123abc' --- +string(4) "0707" +--- testing: '65' ^ '123e5' --- +string(4) "0707" +--- testing: '65' ^ '123e5xyz' --- +string(4) "0707" +--- testing: '65' ^ ' 123abc' --- +string(4) "1604" +--- testing: '65' ^ '123 abc' --- +string(4) "0707" +--- testing: '65' ^ '123abc ' --- +string(4) "0707" +--- testing: '65' ^ '3.4a' --- +string(4) "051b" +--- testing: '65' ^ 'a5.9' --- +string(4) "5700" +--- testing: '-44' ^ '0' --- +string(2) "1d" +--- testing: '-44' ^ '65' --- +string(4) "1b01" +--- testing: '-44' ^ '-44' --- +string(6) "000000" +--- testing: '-44' ^ '1.2' --- +string(6) "1c1a06" +--- testing: '-44' ^ '-7.7' --- +string(6) "00031a" +--- testing: '-44' ^ 'abc' --- +string(6) "4c5657" +--- testing: '-44' ^ '123abc' --- +string(6) "1c0607" +--- testing: '-44' ^ '123e5' --- +string(6) "1c0607" +--- testing: '-44' ^ '123e5xyz' --- +string(6) "1c0607" +--- testing: '-44' ^ ' 123abc' --- +string(6) "0d0506" +--- testing: '-44' ^ '123 abc' --- +string(6) "1c0607" +--- testing: '-44' ^ '123abc ' --- +string(6) "1c0607" +--- testing: '-44' ^ '3.4a' --- +string(6) "1e1a00" +--- testing: '-44' ^ 'a5.9' --- +string(6) "4c011a" +--- testing: '1.2' ^ '0' --- +string(2) "01" +--- testing: '1.2' ^ '65' --- +string(4) "071b" +--- testing: '1.2' ^ '-44' --- +string(6) "1c1a06" +--- testing: '1.2' ^ '1.2' --- +string(6) "000000" +--- testing: '1.2' ^ '-7.7' --- +string(6) "1c191c" +--- testing: '1.2' ^ 'abc' --- +string(6) "504c51" +--- testing: '1.2' ^ '123abc' --- +string(6) "001c01" +--- testing: '1.2' ^ '123e5' --- +string(6) "001c01" +--- testing: '1.2' ^ '123e5xyz' --- +string(6) "001c01" +--- testing: '1.2' ^ ' 123abc' --- +string(6) "111f00" +--- testing: '1.2' ^ '123 abc' --- +string(6) "001c01" +--- testing: '1.2' ^ '123abc ' --- +string(6) "001c01" +--- testing: '1.2' ^ '3.4a' --- +string(6) "020006" +--- testing: '1.2' ^ 'a5.9' --- +string(6) "501b1c" +--- testing: '-7.7' ^ '0' --- +string(2) "1d" +--- testing: '-7.7' ^ '65' --- +string(4) "1b02" +--- testing: '-7.7' ^ '-44' --- +string(6) "00031a" +--- testing: '-7.7' ^ '1.2' --- +string(6) "1c191c" +--- testing: '-7.7' ^ '-7.7' --- +string(8) "00000000" +--- testing: '-7.7' ^ 'abc' --- +string(6) "4c554d" +--- testing: '-7.7' ^ '123abc' --- +string(8) "1c051d56" +--- testing: '-7.7' ^ '123e5' --- +string(8) "1c051d52" +--- testing: '-7.7' ^ '123e5xyz' --- +string(8) "1c051d52" +--- testing: '-7.7' ^ ' 123abc' --- +string(8) "0d061c04" +--- testing: '-7.7' ^ '123 abc' --- +string(8) "1c051d17" +--- testing: '-7.7' ^ '123abc ' --- +string(8) "1c051d56" +--- testing: '-7.7' ^ '3.4a' --- +string(8) "1e191a56" +--- testing: '-7.7' ^ 'a5.9' --- +string(8) "4c02000e" +--- testing: 'abc' ^ '0' --- +string(2) "51" +--- testing: 'abc' ^ '65' --- +string(4) "5757" +--- testing: 'abc' ^ '-44' --- +string(6) "4c5657" +--- testing: 'abc' ^ '1.2' --- +string(6) "504c51" +--- testing: 'abc' ^ '-7.7' --- +string(6) "4c554d" +--- testing: 'abc' ^ 'abc' --- +string(6) "000000" +--- testing: 'abc' ^ '123abc' --- +string(6) "505050" +--- testing: 'abc' ^ '123e5' --- +string(6) "505050" +--- testing: 'abc' ^ '123e5xyz' --- +string(6) "505050" +--- testing: 'abc' ^ ' 123abc' --- +string(6) "415351" +--- testing: 'abc' ^ '123 abc' --- +string(6) "505050" +--- testing: 'abc' ^ '123abc ' --- +string(6) "505050" +--- testing: 'abc' ^ '3.4a' --- +string(6) "524c57" +--- testing: 'abc' ^ 'a5.9' --- +string(6) "00574d" +--- testing: '123abc' ^ '0' --- +string(2) "01" +--- testing: '123abc' ^ '65' --- +string(4) "0707" +--- testing: '123abc' ^ '-44' --- +string(6) "1c0607" +--- testing: '123abc' ^ '1.2' --- +string(6) "001c01" +--- testing: '123abc' ^ '-7.7' --- +string(8) "1c051d56" +--- testing: '123abc' ^ 'abc' --- +string(6) "505050" +--- testing: '123abc' ^ '123abc' --- +string(12) "000000000000" +--- testing: '123abc' ^ '123e5' --- +string(10) "0000000457" +--- testing: '123abc' ^ '123e5xyz' --- +string(12) "00000004571b" +--- testing: '123abc' ^ ' 123abc' --- +string(12) "110301520301" +--- testing: '123abc' ^ '123 abc' --- +string(12) "000000410301" +--- testing: '123abc' ^ '123abc ' --- +string(12) "000000000000" +--- testing: '123abc' ^ '3.4a' --- +string(8) "021c0700" +--- testing: '123abc' ^ 'a5.9' --- +string(8) "50071d58" +--- testing: '123e5' ^ '0' --- +string(2) "01" +--- testing: '123e5' ^ '65' --- +string(4) "0707" +--- testing: '123e5' ^ '-44' --- +string(6) "1c0607" +--- testing: '123e5' ^ '1.2' --- +string(6) "001c01" +--- testing: '123e5' ^ '-7.7' --- +string(8) "1c051d52" +--- testing: '123e5' ^ 'abc' --- +string(6) "505050" +--- testing: '123e5' ^ '123abc' --- +string(10) "0000000457" +--- testing: '123e5' ^ '123e5' --- +string(10) "0000000000" +--- testing: '123e5' ^ '123e5xyz' --- +string(10) "0000000000" +--- testing: '123e5' ^ ' 123abc' --- +string(10) "1103015654" +--- testing: '123e5' ^ '123 abc' --- +string(10) "0000004554" +--- testing: '123e5' ^ '123abc ' --- +string(10) "0000000457" +--- testing: '123e5' ^ '3.4a' --- +string(8) "021c0704" +--- testing: '123e5' ^ 'a5.9' --- +string(8) "50071d5c" +--- testing: '123e5xyz' ^ '0' --- +string(2) "01" +--- testing: '123e5xyz' ^ '65' --- +string(4) "0707" +--- testing: '123e5xyz' ^ '-44' --- +string(6) "1c0607" +--- testing: '123e5xyz' ^ '1.2' --- +string(6) "001c01" +--- testing: '123e5xyz' ^ '-7.7' --- +string(8) "1c051d52" +--- testing: '123e5xyz' ^ 'abc' --- +string(6) "505050" +--- testing: '123e5xyz' ^ '123abc' --- +string(12) "00000004571b" +--- testing: '123e5xyz' ^ '123e5' --- +string(10) "0000000000" +--- testing: '123e5xyz' ^ '123e5xyz' --- +string(16) "0000000000000000" +--- testing: '123e5xyz' ^ ' 123abc' --- +string(14) "11030156541a1a" +--- testing: '123e5xyz' ^ '123 abc' --- +string(14) "00000045541a1a" +--- testing: '123e5xyz' ^ '123abc ' --- +string(14) "00000004571b59" +--- testing: '123e5xyz' ^ '3.4a' --- +string(8) "021c0704" +--- testing: '123e5xyz' ^ 'a5.9' --- +string(8) "50071d5c" +--- testing: ' 123abc' ^ '0' --- +string(2) "10" +--- testing: ' 123abc' ^ '65' --- +string(4) "1604" +--- testing: ' 123abc' ^ '-44' --- +string(6) "0d0506" +--- testing: ' 123abc' ^ '1.2' --- +string(6) "111f00" +--- testing: ' 123abc' ^ '-7.7' --- +string(8) "0d061c04" +--- testing: ' 123abc' ^ 'abc' --- +string(6) "415351" +--- testing: ' 123abc' ^ '123abc' --- +string(12) "110301520301" +--- testing: ' 123abc' ^ '123e5' --- +string(10) "1103015654" +--- testing: ' 123abc' ^ '123e5xyz' --- +string(14) "11030156541a1a" +--- testing: ' 123abc' ^ ' 123abc' --- +string(14) "00000000000000" +--- testing: ' 123abc' ^ '123 abc' --- +string(14) "11030113000000" +--- testing: ' 123abc' ^ '123abc ' --- +string(14) "11030152030143" +--- testing: ' 123abc' ^ '3.4a' --- +string(8) "131f0652" +--- testing: ' 123abc' ^ 'a5.9' --- +string(8) "41041c0a" +--- testing: '123 abc' ^ '0' --- +string(2) "01" +--- testing: '123 abc' ^ '65' --- +string(4) "0707" +--- testing: '123 abc' ^ '-44' --- +string(6) "1c0607" +--- testing: '123 abc' ^ '1.2' --- +string(6) "001c01" +--- testing: '123 abc' ^ '-7.7' --- +string(8) "1c051d17" +--- testing: '123 abc' ^ 'abc' --- +string(6) "505050" +--- testing: '123 abc' ^ '123abc' --- +string(12) "000000410301" +--- testing: '123 abc' ^ '123e5' --- +string(10) "0000004554" +--- testing: '123 abc' ^ '123e5xyz' --- +string(14) "00000045541a1a" +--- testing: '123 abc' ^ ' 123abc' --- +string(14) "11030113000000" +--- testing: '123 abc' ^ '123 abc' --- +string(14) "00000000000000" +--- testing: '123 abc' ^ '123abc ' --- +string(14) "00000041030143" +--- testing: '123 abc' ^ '3.4a' --- +string(8) "021c0741" +--- testing: '123 abc' ^ 'a5.9' --- +string(8) "50071d19" +--- testing: '123abc ' ^ '0' --- +string(2) "01" +--- testing: '123abc ' ^ '65' --- +string(4) "0707" +--- testing: '123abc ' ^ '-44' --- +string(6) "1c0607" +--- testing: '123abc ' ^ '1.2' --- +string(6) "001c01" +--- testing: '123abc ' ^ '-7.7' --- +string(8) "1c051d56" +--- testing: '123abc ' ^ 'abc' --- +string(6) "505050" +--- testing: '123abc ' ^ '123abc' --- +string(12) "000000000000" +--- testing: '123abc ' ^ '123e5' --- +string(10) "0000000457" +--- testing: '123abc ' ^ '123e5xyz' --- +string(14) "00000004571b59" +--- testing: '123abc ' ^ ' 123abc' --- +string(14) "11030152030143" +--- testing: '123abc ' ^ '123 abc' --- +string(14) "00000041030143" +--- testing: '123abc ' ^ '123abc ' --- +string(14) "00000000000000" +--- testing: '123abc ' ^ '3.4a' --- +string(8) "021c0700" +--- testing: '123abc ' ^ 'a5.9' --- +string(8) "50071d58" +--- testing: '3.4a' ^ '0' --- +string(2) "03" +--- testing: '3.4a' ^ '65' --- +string(4) "051b" +--- testing: '3.4a' ^ '-44' --- +string(6) "1e1a00" +--- testing: '3.4a' ^ '1.2' --- +string(6) "020006" +--- testing: '3.4a' ^ '-7.7' --- +string(8) "1e191a56" +--- testing: '3.4a' ^ 'abc' --- +string(6) "524c57" +--- testing: '3.4a' ^ '123abc' --- +string(8) "021c0700" +--- testing: '3.4a' ^ '123e5' --- +string(8) "021c0704" +--- testing: '3.4a' ^ '123e5xyz' --- +string(8) "021c0704" +--- testing: '3.4a' ^ ' 123abc' --- +string(8) "131f0652" +--- testing: '3.4a' ^ '123 abc' --- +string(8) "021c0741" +--- testing: '3.4a' ^ '123abc ' --- +string(8) "021c0700" +--- testing: '3.4a' ^ '3.4a' --- +string(8) "00000000" +--- testing: '3.4a' ^ 'a5.9' --- +string(8) "521b1a58" +--- testing: 'a5.9' ^ '0' --- +string(2) "51" +--- testing: 'a5.9' ^ '65' --- +string(4) "5700" +--- testing: 'a5.9' ^ '-44' --- +string(6) "4c011a" +--- testing: 'a5.9' ^ '1.2' --- +string(6) "501b1c" +--- testing: 'a5.9' ^ '-7.7' --- +string(8) "4c02000e" +--- testing: 'a5.9' ^ 'abc' --- +string(6) "00574d" +--- testing: 'a5.9' ^ '123abc' --- +string(8) "50071d58" +--- testing: 'a5.9' ^ '123e5' --- +string(8) "50071d5c" +--- testing: 'a5.9' ^ '123e5xyz' --- +string(8) "50071d5c" +--- testing: 'a5.9' ^ ' 123abc' --- +string(8) "41041c0a" +--- testing: 'a5.9' ^ '123 abc' --- +string(8) "50071d19" +--- testing: 'a5.9' ^ '123abc ' --- +string(8) "50071d58" +--- testing: 'a5.9' ^ '3.4a' --- +string(8) "521b1a58" +--- testing: 'a5.9' ^ 'a5.9' --- +string(8) "00000000" +===DONE=== diff --git a/tests/lang/operators/divide_basiclong_64bit.phpt b/tests/lang/operators/divide_basiclong_64bit.phpt new file mode 100644 index 0000000..b5d6df9 --- /dev/null +++ b/tests/lang/operators/divide_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test / operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 / 0 --- +bool(false) +--- testing: 9223372036854775807 / 1 --- +int(9223372036854775807) +--- testing: 9223372036854775807 / -1 --- +int(-9223372036854775807) +--- testing: 9223372036854775807 / 7 --- +int(1317624576693539401) +--- testing: 9223372036854775807 / 9 --- +float(1.0248191152061E+18) +--- testing: 9223372036854775807 / 65 --- +float(1.4189803133623E+17) +--- testing: 9223372036854775807 / -44 --- +float(-2.096220917467E+17) +--- testing: 9223372036854775807 / 2147483647 --- +float(4294967298) +--- testing: 9223372036854775807 / 9223372036854775807 --- +int(1) +--- testing: -9223372036854775808 / 0 --- +bool(false) +--- testing: -9223372036854775808 / 1 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 / -1 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775808 / 7 --- +float(-1.3176245766935E+18) +--- testing: -9223372036854775808 / 9 --- +float(-1.0248191152061E+18) +--- testing: -9223372036854775808 / 65 --- +float(-1.4189803133623E+17) +--- testing: -9223372036854775808 / -44 --- +float(2.096220917467E+17) +--- testing: -9223372036854775808 / 2147483647 --- +float(-4294967298) +--- testing: -9223372036854775808 / 9223372036854775807 --- +float(-1) +--- testing: 2147483647 / 0 --- +bool(false) +--- testing: 2147483647 / 1 --- +int(2147483647) +--- testing: 2147483647 / -1 --- +int(-2147483647) +--- testing: 2147483647 / 7 --- +float(306783378.14286) +--- testing: 2147483647 / 9 --- +float(238609294.11111) +--- testing: 2147483647 / 65 --- +float(33038209.953846) +--- testing: 2147483647 / -44 --- +float(-48806446.522727) +--- testing: 2147483647 / 2147483647 --- +int(1) +--- testing: 2147483647 / 9223372036854775807 --- +float(2.3283064354545E-10) +--- testing: -2147483648 / 0 --- +bool(false) +--- testing: -2147483648 / 1 --- +int(-2147483648) +--- testing: -2147483648 / -1 --- +int(2147483648) +--- testing: -2147483648 / 7 --- +float(-306783378.28571) +--- testing: -2147483648 / 9 --- +float(-238609294.22222) +--- testing: -2147483648 / 65 --- +float(-33038209.969231) +--- testing: -2147483648 / -44 --- +float(48806446.545455) +--- testing: -2147483648 / 2147483647 --- +float(-1.0000000004657) +--- testing: -2147483648 / 9223372036854775807 --- +float(-2.3283064365387E-10) +--- testing: 9223372034707292160 / 0 --- +bool(false) +--- testing: 9223372034707292160 / 1 --- +int(9223372034707292160) +--- testing: 9223372034707292160 / -1 --- +int(-9223372034707292160) +--- testing: 9223372034707292160 / 7 --- +float(1.3176245763868E+18) +--- testing: 9223372034707292160 / 9 --- +float(1.0248191149675E+18) +--- testing: 9223372034707292160 / 65 --- +float(1.4189803130319E+17) +--- testing: 9223372034707292160 / -44 --- +float(-2.0962209169789E+17) +--- testing: 9223372034707292160 / 2147483647 --- +float(4294967297) +--- testing: 9223372034707292160 / 9223372036854775807 --- +float(0.99999999976717) +--- testing: -9223372034707292160 / 0 --- +bool(false) +--- testing: -9223372034707292160 / 1 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 / -1 --- +int(9223372034707292160) +--- testing: -9223372034707292160 / 7 --- +float(-1.3176245763868E+18) +--- testing: -9223372034707292160 / 9 --- +float(-1.0248191149675E+18) +--- testing: -9223372034707292160 / 65 --- +float(-1.4189803130319E+17) +--- testing: -9223372034707292160 / -44 --- +float(2.0962209169789E+17) +--- testing: -9223372034707292160 / 2147483647 --- +float(-4294967297) +--- testing: -9223372034707292160 / 9223372036854775807 --- +float(-0.99999999976717) +--- testing: 2147483648 / 0 --- +bool(false) +--- testing: 2147483648 / 1 --- +int(2147483648) +--- testing: 2147483648 / -1 --- +int(-2147483648) +--- testing: 2147483648 / 7 --- +float(306783378.28571) +--- testing: 2147483648 / 9 --- +float(238609294.22222) +--- testing: 2147483648 / 65 --- +float(33038209.969231) +--- testing: 2147483648 / -44 --- +float(-48806446.545455) +--- testing: 2147483648 / 2147483647 --- +float(1.0000000004657) +--- testing: 2147483648 / 9223372036854775807 --- +float(2.3283064365387E-10) +--- testing: -2147483649 / 0 --- +bool(false) +--- testing: -2147483649 / 1 --- +int(-2147483649) +--- testing: -2147483649 / -1 --- +int(2147483649) +--- testing: -2147483649 / 7 --- +float(-306783378.42857) +--- testing: -2147483649 / 9 --- +float(-238609294.33333) +--- testing: -2147483649 / 65 --- +float(-33038209.984615) +--- testing: -2147483649 / -44 --- +float(48806446.568182) +--- testing: -2147483649 / 2147483647 --- +float(-1.0000000009313) +--- testing: -2147483649 / 9223372036854775807 --- +float(-2.3283064376229E-10) +--- testing: 4294967294 / 0 --- +bool(false) +--- testing: 4294967294 / 1 --- +int(4294967294) +--- testing: 4294967294 / -1 --- +int(-4294967294) +--- testing: 4294967294 / 7 --- +float(613566756.28571) +--- testing: 4294967294 / 9 --- +float(477218588.22222) +--- testing: 4294967294 / 65 --- +float(66076419.907692) +--- testing: 4294967294 / -44 --- +float(-97612893.045455) +--- testing: 4294967294 / 2147483647 --- +int(2) +--- testing: 4294967294 / 9223372036854775807 --- +float(4.656612870909E-10) +--- testing: 4294967295 / 0 --- +bool(false) +--- testing: 4294967295 / 1 --- +int(4294967295) +--- testing: 4294967295 / -1 --- +int(-4294967295) +--- testing: 4294967295 / 7 --- +float(613566756.42857) +--- testing: 4294967295 / 9 --- +float(477218588.33333) +--- testing: 4294967295 / 65 --- +float(66076419.923077) +--- testing: 4294967295 / -44 --- +float(-97612893.068182) +--- testing: 4294967295 / 2147483647 --- +float(2.0000000004657) +--- testing: 4294967295 / 9223372036854775807 --- +float(4.6566128719932E-10) +--- testing: 4294967293 / 0 --- +bool(false) +--- testing: 4294967293 / 1 --- +int(4294967293) +--- testing: 4294967293 / -1 --- +int(-4294967293) +--- testing: 4294967293 / 7 --- +float(613566756.14286) +--- testing: 4294967293 / 9 --- +float(477218588.11111) +--- testing: 4294967293 / 65 --- +float(66076419.892308) +--- testing: 4294967293 / -44 --- +float(-97612893.022727) +--- testing: 4294967293 / 2147483647 --- +float(1.9999999995343) +--- testing: 4294967293 / 9223372036854775807 --- +float(4.6566128698248E-10) +--- testing: 9223372036854775806 / 0 --- +bool(false) +--- testing: 9223372036854775806 / 1 --- +int(9223372036854775806) +--- testing: 9223372036854775806 / -1 --- +int(-9223372036854775806) +--- testing: 9223372036854775806 / 7 --- +float(1.3176245766935E+18) +--- testing: 9223372036854775806 / 9 --- +float(1.0248191152061E+18) +--- testing: 9223372036854775806 / 65 --- +float(1.4189803133623E+17) +--- testing: 9223372036854775806 / -44 --- +float(-2.096220917467E+17) +--- testing: 9223372036854775806 / 2147483647 --- +int(4294967298) +--- testing: 9223372036854775806 / 9223372036854775807 --- +float(1) +--- testing: 9.2233720368548E+18 / 0 --- +bool(false) +--- testing: 9.2233720368548E+18 / 1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 / -1 --- +float(-9.2233720368548E+18) +--- testing: 9.2233720368548E+18 / 7 --- +float(1.3176245766935E+18) +--- testing: 9.2233720368548E+18 / 9 --- +float(1.0248191152061E+18) +--- testing: 9.2233720368548E+18 / 65 --- +float(1.4189803133623E+17) +--- testing: 9.2233720368548E+18 / -44 --- +float(-2.096220917467E+17) +--- testing: 9.2233720368548E+18 / 2147483647 --- +float(4294967298) +--- testing: 9.2233720368548E+18 / 9223372036854775807 --- +float(1) +--- testing: -9223372036854775807 / 0 --- +bool(false) +--- testing: -9223372036854775807 / 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 / -1 --- +int(9223372036854775807) +--- testing: -9223372036854775807 / 7 --- +int(-1317624576693539401) +--- testing: -9223372036854775807 / 9 --- +float(-1.0248191152061E+18) +--- testing: -9223372036854775807 / 65 --- +float(-1.4189803133623E+17) +--- testing: -9223372036854775807 / -44 --- +float(2.096220917467E+17) +--- testing: -9223372036854775807 / 2147483647 --- +float(-4294967298) +--- testing: -9223372036854775807 / 9223372036854775807 --- +int(-1) +--- testing: -9.2233720368548E+18 / 0 --- +bool(false) +--- testing: -9.2233720368548E+18 / 1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 / -1 --- +float(9.2233720368548E+18) +--- testing: -9.2233720368548E+18 / 7 --- +float(-1.3176245766935E+18) +--- testing: -9.2233720368548E+18 / 9 --- +float(-1.0248191152061E+18) +--- testing: -9.2233720368548E+18 / 65 --- +float(-1.4189803133623E+17) +--- testing: -9.2233720368548E+18 / -44 --- +float(2.096220917467E+17) +--- testing: -9.2233720368548E+18 / 2147483647 --- +float(-4294967298) +--- testing: -9.2233720368548E+18 / 9223372036854775807 --- +float(-1) +--- testing: 0 / 9223372036854775807 --- +int(0) +--- testing: 0 / -9223372036854775808 --- +int(0) +--- testing: 0 / 2147483647 --- +int(0) +--- testing: 0 / -2147483648 --- +int(0) +--- testing: 0 / 9223372034707292160 --- +int(0) +--- testing: 0 / -9223372034707292160 --- +int(0) +--- testing: 0 / 2147483648 --- +int(0) +--- testing: 0 / -2147483649 --- +int(0) +--- testing: 0 / 4294967294 --- +int(0) +--- testing: 0 / 4294967295 --- +int(0) +--- testing: 0 / 4294967293 --- +int(0) +--- testing: 0 / 9223372036854775806 --- +int(0) +--- testing: 0 / 9.2233720368548E+18 --- +float(0) +--- testing: 0 / -9223372036854775807 --- +int(0) +--- testing: 0 / -9.2233720368548E+18 --- +float(-0) +--- testing: 1 / 9223372036854775807 --- +float(1.0842021724855E-19) +--- testing: 1 / -9223372036854775808 --- +float(-1.0842021724855E-19) +--- testing: 1 / 2147483647 --- +float(4.6566128752458E-10) +--- testing: 1 / -2147483648 --- +float(-4.6566128730774E-10) +--- testing: 1 / 9223372034707292160 --- +float(1.0842021727379E-19) +--- testing: 1 / -9223372034707292160 --- +float(-1.0842021727379E-19) +--- testing: 1 / 2147483648 --- +float(4.6566128730774E-10) +--- testing: 1 / -2147483649 --- +float(-4.656612870909E-10) +--- testing: 1 / 4294967294 --- +float(2.3283064376229E-10) +--- testing: 1 / 4294967295 --- +float(2.3283064370808E-10) +--- testing: 1 / 4294967293 --- +float(2.328306438165E-10) +--- testing: 1 / 9223372036854775806 --- +float(1.0842021724855E-19) +--- testing: 1 / 9.2233720368548E+18 --- +float(1.0842021724855E-19) +--- testing: 1 / -9223372036854775807 --- +float(-1.0842021724855E-19) +--- testing: 1 / -9.2233720368548E+18 --- +float(-1.0842021724855E-19) +--- testing: -1 / 9223372036854775807 --- +float(-1.0842021724855E-19) +--- testing: -1 / -9223372036854775808 --- +float(1.0842021724855E-19) +--- testing: -1 / 2147483647 --- +float(-4.6566128752458E-10) +--- testing: -1 / -2147483648 --- +float(4.6566128730774E-10) +--- testing: -1 / 9223372034707292160 --- +float(-1.0842021727379E-19) +--- testing: -1 / -9223372034707292160 --- +float(1.0842021727379E-19) +--- testing: -1 / 2147483648 --- +float(-4.6566128730774E-10) +--- testing: -1 / -2147483649 --- +float(4.656612870909E-10) +--- testing: -1 / 4294967294 --- +float(-2.3283064376229E-10) +--- testing: -1 / 4294967295 --- +float(-2.3283064370808E-10) +--- testing: -1 / 4294967293 --- +float(-2.328306438165E-10) +--- testing: -1 / 9223372036854775806 --- +float(-1.0842021724855E-19) +--- testing: -1 / 9.2233720368548E+18 --- +float(-1.0842021724855E-19) +--- testing: -1 / -9223372036854775807 --- +float(1.0842021724855E-19) +--- testing: -1 / -9.2233720368548E+18 --- +float(1.0842021724855E-19) +--- testing: 7 / 9223372036854775807 --- +float(7.5894152073985E-19) +--- testing: 7 / -9223372036854775808 --- +float(-7.5894152073985E-19) +--- testing: 7 / 2147483647 --- +float(3.2596290126721E-9) +--- testing: 7 / -2147483648 --- +float(-3.2596290111542E-9) +--- testing: 7 / 9223372034707292160 --- +float(7.5894152091656E-19) +--- testing: 7 / -9223372034707292160 --- +float(-7.5894152091656E-19) +--- testing: 7 / 2147483648 --- +float(3.2596290111542E-9) +--- testing: 7 / -2147483649 --- +float(-3.2596290096363E-9) +--- testing: 7 / 4294967294 --- +float(1.629814506336E-9) +--- testing: 7 / 4294967295 --- +float(1.6298145059566E-9) +--- testing: 7 / 4294967293 --- +float(1.6298145067155E-9) +--- testing: 7 / 9223372036854775806 --- +float(7.5894152073985E-19) +--- testing: 7 / 9.2233720368548E+18 --- +float(7.5894152073985E-19) +--- testing: 7 / -9223372036854775807 --- +float(-7.5894152073985E-19) +--- testing: 7 / -9.2233720368548E+18 --- +float(-7.5894152073985E-19) +--- testing: 9 / 9223372036854775807 --- +float(9.7578195523695E-19) +--- testing: 9 / -9223372036854775808 --- +float(-9.7578195523695E-19) +--- testing: 9 / 2147483647 --- +float(4.1909515877212E-9) +--- testing: 9 / -2147483648 --- +float(-4.1909515857697E-9) +--- testing: 9 / 9223372034707292160 --- +float(9.7578195546415E-19) +--- testing: 9 / -9223372034707292160 --- +float(-9.7578195546415E-19) +--- testing: 9 / 2147483648 --- +float(4.1909515857697E-9) +--- testing: 9 / -2147483649 --- +float(-4.1909515838181E-9) +--- testing: 9 / 4294967294 --- +float(2.0954757938606E-9) +--- testing: 9 / 4294967295 --- +float(2.0954757933727E-9) +--- testing: 9 / 4294967293 --- +float(2.0954757943485E-9) +--- testing: 9 / 9223372036854775806 --- +float(9.7578195523695E-19) +--- testing: 9 / 9.2233720368548E+18 --- +float(9.7578195523695E-19) +--- testing: 9 / -9223372036854775807 --- +float(-9.7578195523695E-19) +--- testing: 9 / -9.2233720368548E+18 --- +float(-9.7578195523695E-19) +--- testing: 65 / 9223372036854775807 --- +float(7.0473141211558E-18) +--- testing: 65 / -9223372036854775808 --- +float(-7.0473141211558E-18) +--- testing: 65 / 2147483647 --- +float(3.0267983689098E-8) +--- testing: 65 / -2147483648 --- +float(-3.0267983675003E-8) +--- testing: 65 / 9223372034707292160 --- +float(7.0473141227966E-18) +--- testing: 65 / -9223372034707292160 --- +float(-7.0473141227966E-18) +--- testing: 65 / 2147483648 --- +float(3.0267983675003E-8) +--- testing: 65 / -2147483649 --- +float(-3.0267983660908E-8) +--- testing: 65 / 4294967294 --- +float(1.5133991844549E-8) +--- testing: 65 / 4294967295 --- +float(1.5133991841025E-8) +--- testing: 65 / 4294967293 --- +float(1.5133991848072E-8) +--- testing: 65 / 9223372036854775806 --- +float(7.0473141211558E-18) +--- testing: 65 / 9.2233720368548E+18 --- +float(7.0473141211558E-18) +--- testing: 65 / -9223372036854775807 --- +float(-7.0473141211558E-18) +--- testing: 65 / -9.2233720368548E+18 --- +float(-7.0473141211558E-18) +--- testing: -44 / 9223372036854775807 --- +float(-4.7704895589362E-18) +--- testing: -44 / -9223372036854775808 --- +float(4.7704895589362E-18) +--- testing: -44 / 2147483647 --- +float(-2.0489096651082E-8) +--- testing: -44 / -2147483648 --- +float(2.0489096641541E-8) +--- testing: -44 / 9223372034707292160 --- +float(-4.7704895600469E-18) +--- testing: -44 / -9223372034707292160 --- +float(4.7704895600469E-18) +--- testing: -44 / 2147483648 --- +float(-2.0489096641541E-8) +--- testing: -44 / -2147483649 --- +float(2.0489096632E-8) +--- testing: -44 / 4294967294 --- +float(-1.0244548325541E-8) +--- testing: -44 / 4294967295 --- +float(-1.0244548323156E-8) +--- testing: -44 / 4294967293 --- +float(-1.0244548327926E-8) +--- testing: -44 / 9223372036854775806 --- +float(-4.7704895589362E-18) +--- testing: -44 / 9.2233720368548E+18 --- +float(-4.7704895589362E-18) +--- testing: -44 / -9223372036854775807 --- +float(4.7704895589362E-18) +--- testing: -44 / -9.2233720368548E+18 --- +float(4.7704895589362E-18) +--- testing: 2147483647 / 9223372036854775807 --- +float(2.3283064354545E-10) +--- testing: 2147483647 / -9223372036854775808 --- +float(-2.3283064354545E-10) +--- testing: 2147483647 / 2147483647 --- +int(1) +--- testing: 2147483647 / -2147483648 --- +float(-0.99999999953434) +--- testing: 2147483647 / 9223372034707292160 --- +float(2.3283064359966E-10) +--- testing: 2147483647 / -9223372034707292160 --- +float(-2.3283064359966E-10) +--- testing: 2147483647 / 2147483648 --- +float(0.99999999953434) +--- testing: 2147483647 / -2147483649 --- +float(-0.99999999906868) +--- testing: 2147483647 / 4294967294 --- +float(0.5) +--- testing: 2147483647 / 4294967295 --- +float(0.49999999988358) +--- testing: 2147483647 / 4294967293 --- +float(0.50000000011642) +--- testing: 2147483647 / 9223372036854775806 --- +float(2.3283064354545E-10) +--- testing: 2147483647 / 9.2233720368548E+18 --- +float(2.3283064354545E-10) +--- testing: 2147483647 / -9223372036854775807 --- +float(-2.3283064354545E-10) +--- testing: 2147483647 / -9.2233720368548E+18 --- +float(-2.3283064354545E-10) +--- testing: 9223372036854775807 / 9223372036854775807 --- +int(1) +--- testing: 9223372036854775807 / -9223372036854775808 --- +float(-1) +--- testing: 9223372036854775807 / 2147483647 --- +float(4294967298) +--- testing: 9223372036854775807 / -2147483648 --- +float(-4294967296) +--- testing: 9223372036854775807 / 9223372034707292160 --- +float(1.0000000002328) +--- testing: 9223372036854775807 / -9223372034707292160 --- +float(-1.0000000002328) +--- testing: 9223372036854775807 / 2147483648 --- +float(4294967296) +--- testing: 9223372036854775807 / -2147483649 --- +float(-4294967294) +--- testing: 9223372036854775807 / 4294967294 --- +float(2147483649) +--- testing: 9223372036854775807 / 4294967295 --- +float(2147483648.5) +--- testing: 9223372036854775807 / 4294967293 --- +float(2147483649.5) +--- testing: 9223372036854775807 / 9223372036854775806 --- +float(1) +--- testing: 9223372036854775807 / 9.2233720368548E+18 --- +float(1) +--- testing: 9223372036854775807 / -9223372036854775807 --- +int(-1) +--- testing: 9223372036854775807 / -9.2233720368548E+18 --- +float(-1) +===DONE=== diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt new file mode 100644 index 0000000..e48e9e1 --- /dev/null +++ b/tests/lang/operators/divide_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test / operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' / '0' --- +bool(false) +--- testing: '0' / '65' --- +int(0) +--- testing: '0' / '-44' --- +int(0) +--- testing: '0' / '1.2' --- +float(0) +--- testing: '0' / '-7.7' --- +float(-0) +--- testing: '0' / 'abc' --- +bool(false) +--- testing: '0' / '123abc' --- +int(0) +--- testing: '0' / '123e5' --- +float(0) +--- testing: '0' / '123e5xyz' --- +float(0) +--- testing: '0' / ' 123abc' --- +int(0) +--- testing: '0' / '123 abc' --- +int(0) +--- testing: '0' / '123abc ' --- +int(0) +--- testing: '0' / '3.4a' --- +float(0) +--- testing: '0' / 'a5.9' --- +bool(false) +--- testing: '65' / '0' --- +bool(false) +--- testing: '65' / '65' --- +int(1) +--- testing: '65' / '-44' --- +float(-1.4772727272727) +--- testing: '65' / '1.2' --- +float(54.166666666667) +--- testing: '65' / '-7.7' --- +float(-8.4415584415584) +--- testing: '65' / 'abc' --- +bool(false) +--- testing: '65' / '123abc' --- +float(0.52845528455285) +--- testing: '65' / '123e5' --- +float(5.2845528455285E-6) +--- testing: '65' / '123e5xyz' --- +float(5.2845528455285E-6) +--- testing: '65' / ' 123abc' --- +float(0.52845528455285) +--- testing: '65' / '123 abc' --- +float(0.52845528455285) +--- testing: '65' / '123abc ' --- +float(0.52845528455285) +--- testing: '65' / '3.4a' --- +float(19.117647058824) +--- testing: '65' / 'a5.9' --- +bool(false) +--- testing: '-44' / '0' --- +bool(false) +--- testing: '-44' / '65' --- +float(-0.67692307692308) +--- testing: '-44' / '-44' --- +int(1) +--- testing: '-44' / '1.2' --- +float(-36.666666666667) +--- testing: '-44' / '-7.7' --- +float(5.7142857142857) +--- testing: '-44' / 'abc' --- +bool(false) +--- testing: '-44' / '123abc' --- +float(-0.35772357723577) +--- testing: '-44' / '123e5' --- +float(-3.5772357723577E-6) +--- testing: '-44' / '123e5xyz' --- +float(-3.5772357723577E-6) +--- testing: '-44' / ' 123abc' --- +float(-0.35772357723577) +--- testing: '-44' / '123 abc' --- +float(-0.35772357723577) +--- testing: '-44' / '123abc ' --- +float(-0.35772357723577) +--- testing: '-44' / '3.4a' --- +float(-12.941176470588) +--- testing: '-44' / 'a5.9' --- +bool(false) +--- testing: '1.2' / '0' --- +bool(false) +--- testing: '1.2' / '65' --- +float(0.018461538461538) +--- testing: '1.2' / '-44' --- +float(-0.027272727272727) +--- testing: '1.2' / '1.2' --- +float(1) +--- testing: '1.2' / '-7.7' --- +float(-0.15584415584416) +--- testing: '1.2' / 'abc' --- +bool(false) +--- testing: '1.2' / '123abc' --- +float(0.0097560975609756) +--- testing: '1.2' / '123e5' --- +float(9.7560975609756E-8) +--- testing: '1.2' / '123e5xyz' --- +float(9.7560975609756E-8) +--- testing: '1.2' / ' 123abc' --- +float(0.0097560975609756) +--- testing: '1.2' / '123 abc' --- +float(0.0097560975609756) +--- testing: '1.2' / '123abc ' --- +float(0.0097560975609756) +--- testing: '1.2' / '3.4a' --- +float(0.35294117647059) +--- testing: '1.2' / 'a5.9' --- +bool(false) +--- testing: '-7.7' / '0' --- +bool(false) +--- testing: '-7.7' / '65' --- +float(-0.11846153846154) +--- testing: '-7.7' / '-44' --- +float(0.175) +--- testing: '-7.7' / '1.2' --- +float(-6.4166666666667) +--- testing: '-7.7' / '-7.7' --- +float(1) +--- testing: '-7.7' / 'abc' --- +bool(false) +--- testing: '-7.7' / '123abc' --- +float(-0.06260162601626) +--- testing: '-7.7' / '123e5' --- +float(-6.260162601626E-7) +--- testing: '-7.7' / '123e5xyz' --- +float(-6.260162601626E-7) +--- testing: '-7.7' / ' 123abc' --- +float(-0.06260162601626) +--- testing: '-7.7' / '123 abc' --- +float(-0.06260162601626) +--- testing: '-7.7' / '123abc ' --- +float(-0.06260162601626) +--- testing: '-7.7' / '3.4a' --- +float(-2.2647058823529) +--- testing: '-7.7' / 'a5.9' --- +bool(false) +--- testing: 'abc' / '0' --- +bool(false) +--- testing: 'abc' / '65' --- +int(0) +--- testing: 'abc' / '-44' --- +int(0) +--- testing: 'abc' / '1.2' --- +float(0) +--- testing: 'abc' / '-7.7' --- +float(-0) +--- testing: 'abc' / 'abc' --- +bool(false) +--- testing: 'abc' / '123abc' --- +int(0) +--- testing: 'abc' / '123e5' --- +float(0) +--- testing: 'abc' / '123e5xyz' --- +float(0) +--- testing: 'abc' / ' 123abc' --- +int(0) +--- testing: 'abc' / '123 abc' --- +int(0) +--- testing: 'abc' / '123abc ' --- +int(0) +--- testing: 'abc' / '3.4a' --- +float(0) +--- testing: 'abc' / 'a5.9' --- +bool(false) +--- testing: '123abc' / '0' --- +bool(false) +--- testing: '123abc' / '65' --- +float(1.8923076923077) +--- testing: '123abc' / '-44' --- +float(-2.7954545454545) +--- testing: '123abc' / '1.2' --- +float(102.5) +--- testing: '123abc' / '-7.7' --- +float(-15.974025974026) +--- testing: '123abc' / 'abc' --- +bool(false) +--- testing: '123abc' / '123abc' --- +int(1) +--- testing: '123abc' / '123e5' --- +float(1.0E-5) +--- testing: '123abc' / '123e5xyz' --- +float(1.0E-5) +--- testing: '123abc' / ' 123abc' --- +int(1) +--- testing: '123abc' / '123 abc' --- +int(1) +--- testing: '123abc' / '123abc ' --- +int(1) +--- testing: '123abc' / '3.4a' --- +float(36.176470588235) +--- testing: '123abc' / 'a5.9' --- +bool(false) +--- testing: '123e5' / '0' --- +bool(false) +--- testing: '123e5' / '65' --- +float(189230.76923077) +--- testing: '123e5' / '-44' --- +float(-279545.45454545) +--- testing: '123e5' / '1.2' --- +float(10250000) +--- testing: '123e5' / '-7.7' --- +float(-1597402.5974026) +--- testing: '123e5' / 'abc' --- +bool(false) +--- testing: '123e5' / '123abc' --- +float(100000) +--- testing: '123e5' / '123e5' --- +float(1) +--- testing: '123e5' / '123e5xyz' --- +float(1) +--- testing: '123e5' / ' 123abc' --- +float(100000) +--- testing: '123e5' / '123 abc' --- +float(100000) +--- testing: '123e5' / '123abc ' --- +float(100000) +--- testing: '123e5' / '3.4a' --- +float(3617647.0588235) +--- testing: '123e5' / 'a5.9' --- +bool(false) +--- testing: '123e5xyz' / '0' --- +bool(false) +--- testing: '123e5xyz' / '65' --- +float(189230.76923077) +--- testing: '123e5xyz' / '-44' --- +float(-279545.45454545) +--- testing: '123e5xyz' / '1.2' --- +float(10250000) +--- testing: '123e5xyz' / '-7.7' --- +float(-1597402.5974026) +--- testing: '123e5xyz' / 'abc' --- +bool(false) +--- testing: '123e5xyz' / '123abc' --- +float(100000) +--- testing: '123e5xyz' / '123e5' --- +float(1) +--- testing: '123e5xyz' / '123e5xyz' --- +float(1) +--- testing: '123e5xyz' / ' 123abc' --- +float(100000) +--- testing: '123e5xyz' / '123 abc' --- +float(100000) +--- testing: '123e5xyz' / '123abc ' --- +float(100000) +--- testing: '123e5xyz' / '3.4a' --- +float(3617647.0588235) +--- testing: '123e5xyz' / 'a5.9' --- +bool(false) +--- testing: ' 123abc' / '0' --- +bool(false) +--- testing: ' 123abc' / '65' --- +float(1.8923076923077) +--- testing: ' 123abc' / '-44' --- +float(-2.7954545454545) +--- testing: ' 123abc' / '1.2' --- +float(102.5) +--- testing: ' 123abc' / '-7.7' --- +float(-15.974025974026) +--- testing: ' 123abc' / 'abc' --- +bool(false) +--- testing: ' 123abc' / '123abc' --- +int(1) +--- testing: ' 123abc' / '123e5' --- +float(1.0E-5) +--- testing: ' 123abc' / '123e5xyz' --- +float(1.0E-5) +--- testing: ' 123abc' / ' 123abc' --- +int(1) +--- testing: ' 123abc' / '123 abc' --- +int(1) +--- testing: ' 123abc' / '123abc ' --- +int(1) +--- testing: ' 123abc' / '3.4a' --- +float(36.176470588235) +--- testing: ' 123abc' / 'a5.9' --- +bool(false) +--- testing: '123 abc' / '0' --- +bool(false) +--- testing: '123 abc' / '65' --- +float(1.8923076923077) +--- testing: '123 abc' / '-44' --- +float(-2.7954545454545) +--- testing: '123 abc' / '1.2' --- +float(102.5) +--- testing: '123 abc' / '-7.7' --- +float(-15.974025974026) +--- testing: '123 abc' / 'abc' --- +bool(false) +--- testing: '123 abc' / '123abc' --- +int(1) +--- testing: '123 abc' / '123e5' --- +float(1.0E-5) +--- testing: '123 abc' / '123e5xyz' --- +float(1.0E-5) +--- testing: '123 abc' / ' 123abc' --- +int(1) +--- testing: '123 abc' / '123 abc' --- +int(1) +--- testing: '123 abc' / '123abc ' --- +int(1) +--- testing: '123 abc' / '3.4a' --- +float(36.176470588235) +--- testing: '123 abc' / 'a5.9' --- +bool(false) +--- testing: '123abc ' / '0' --- +bool(false) +--- testing: '123abc ' / '65' --- +float(1.8923076923077) +--- testing: '123abc ' / '-44' --- +float(-2.7954545454545) +--- testing: '123abc ' / '1.2' --- +float(102.5) +--- testing: '123abc ' / '-7.7' --- +float(-15.974025974026) +--- testing: '123abc ' / 'abc' --- +bool(false) +--- testing: '123abc ' / '123abc' --- +int(1) +--- testing: '123abc ' / '123e5' --- +float(1.0E-5) +--- testing: '123abc ' / '123e5xyz' --- +float(1.0E-5) +--- testing: '123abc ' / ' 123abc' --- +int(1) +--- testing: '123abc ' / '123 abc' --- +int(1) +--- testing: '123abc ' / '123abc ' --- +int(1) +--- testing: '123abc ' / '3.4a' --- +float(36.176470588235) +--- testing: '123abc ' / 'a5.9' --- +bool(false) +--- testing: '3.4a' / '0' --- +bool(false) +--- testing: '3.4a' / '65' --- +float(0.052307692307692) +--- testing: '3.4a' / '-44' --- +float(-0.077272727272727) +--- testing: '3.4a' / '1.2' --- +float(2.8333333333333) +--- testing: '3.4a' / '-7.7' --- +float(-0.44155844155844) +--- testing: '3.4a' / 'abc' --- +bool(false) +--- testing: '3.4a' / '123abc' --- +float(0.027642276422764) +--- testing: '3.4a' / '123e5' --- +float(2.7642276422764E-7) +--- testing: '3.4a' / '123e5xyz' --- +float(2.7642276422764E-7) +--- testing: '3.4a' / ' 123abc' --- +float(0.027642276422764) +--- testing: '3.4a' / '123 abc' --- +float(0.027642276422764) +--- testing: '3.4a' / '123abc ' --- +float(0.027642276422764) +--- testing: '3.4a' / '3.4a' --- +float(1) +--- testing: '3.4a' / 'a5.9' --- +bool(false) +--- testing: 'a5.9' / '0' --- +bool(false) +--- testing: 'a5.9' / '65' --- +int(0) +--- testing: 'a5.9' / '-44' --- +int(0) +--- testing: 'a5.9' / '1.2' --- +float(0) +--- testing: 'a5.9' / '-7.7' --- +float(-0) +--- testing: 'a5.9' / 'abc' --- +bool(false) +--- testing: 'a5.9' / '123abc' --- +int(0) +--- testing: 'a5.9' / '123e5' --- +float(0) +--- testing: 'a5.9' / '123e5xyz' --- +float(0) +--- testing: 'a5.9' / ' 123abc' --- +int(0) +--- testing: 'a5.9' / '123 abc' --- +int(0) +--- testing: 'a5.9' / '123abc ' --- +int(0) +--- testing: 'a5.9' / '3.4a' --- +float(0) +--- testing: 'a5.9' / 'a5.9' --- +bool(false) +===DONE=== diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt new file mode 100644 index 0000000..d75ff1e --- /dev/null +++ b/tests/lang/operators/modulus_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test % operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 % 0 --- +bool(false) +--- testing: 9223372036854775807 % 1 --- +int(0) +--- testing: 9223372036854775807 % -1 --- +int(0) +--- testing: 9223372036854775807 % 7 --- +int(0) +--- testing: 9223372036854775807 % 9 --- +int(7) +--- testing: 9223372036854775807 % 65 --- +int(7) +--- testing: 9223372036854775807 % -44 --- +int(7) +--- testing: 9223372036854775807 % 2147483647 --- +int(1) +--- testing: 9223372036854775807 % 9223372036854775807 --- +int(0) +--- testing: -9223372036854775808 % 0 --- +bool(false) +--- testing: -9223372036854775808 % 1 --- +int(0) +--- testing: -9223372036854775808 % -1 --- +int(0) +--- testing: -9223372036854775808 % 7 --- +int(-1) +--- testing: -9223372036854775808 % 9 --- +int(-8) +--- testing: -9223372036854775808 % 65 --- +int(-8) +--- testing: -9223372036854775808 % -44 --- +int(-8) +--- testing: -9223372036854775808 % 2147483647 --- +int(-2) +--- testing: -9223372036854775808 % 9223372036854775807 --- +int(-1) +--- testing: 2147483647 % 0 --- +bool(false) +--- testing: 2147483647 % 1 --- +int(0) +--- testing: 2147483647 % -1 --- +int(0) +--- testing: 2147483647 % 7 --- +int(1) +--- testing: 2147483647 % 9 --- +int(1) +--- testing: 2147483647 % 65 --- +int(62) +--- testing: 2147483647 % -44 --- +int(23) +--- testing: 2147483647 % 2147483647 --- +int(0) +--- testing: 2147483647 % 9223372036854775807 --- +int(2147483647) +--- testing: -2147483648 % 0 --- +bool(false) +--- testing: -2147483648 % 1 --- +int(0) +--- testing: -2147483648 % -1 --- +int(0) +--- testing: -2147483648 % 7 --- +int(-2) +--- testing: -2147483648 % 9 --- +int(-2) +--- testing: -2147483648 % 65 --- +int(-63) +--- testing: -2147483648 % -44 --- +int(-24) +--- testing: -2147483648 % 2147483647 --- +int(-1) +--- testing: -2147483648 % 9223372036854775807 --- +int(-2147483648) +--- testing: 9223372034707292160 % 0 --- +bool(false) +--- testing: 9223372034707292160 % 1 --- +int(0) +--- testing: 9223372034707292160 % -1 --- +int(0) +--- testing: 9223372034707292160 % 7 --- +int(6) +--- testing: 9223372034707292160 % 9 --- +int(6) +--- testing: 9223372034707292160 % 65 --- +int(10) +--- testing: 9223372034707292160 % -44 --- +int(28) +--- testing: 9223372034707292160 % 2147483647 --- +int(1) +--- testing: 9223372034707292160 % 9223372036854775807 --- +int(9223372034707292160) +--- testing: -9223372034707292160 % 0 --- +bool(false) +--- testing: -9223372034707292160 % 1 --- +int(0) +--- testing: -9223372034707292160 % -1 --- +int(0) +--- testing: -9223372034707292160 % 7 --- +int(-6) +--- testing: -9223372034707292160 % 9 --- +int(-6) +--- testing: -9223372034707292160 % 65 --- +int(-10) +--- testing: -9223372034707292160 % -44 --- +int(-28) +--- testing: -9223372034707292160 % 2147483647 --- +int(-1) +--- testing: -9223372034707292160 % 9223372036854775807 --- +int(-9223372034707292160) +--- testing: 2147483648 % 0 --- +bool(false) +--- testing: 2147483648 % 1 --- +int(0) +--- testing: 2147483648 % -1 --- +int(0) +--- testing: 2147483648 % 7 --- +int(2) +--- testing: 2147483648 % 9 --- +int(2) +--- testing: 2147483648 % 65 --- +int(63) +--- testing: 2147483648 % -44 --- +int(24) +--- testing: 2147483648 % 2147483647 --- +int(1) +--- testing: 2147483648 % 9223372036854775807 --- +int(2147483648) +--- testing: -2147483649 % 0 --- +bool(false) +--- testing: -2147483649 % 1 --- +int(0) +--- testing: -2147483649 % -1 --- +int(0) +--- testing: -2147483649 % 7 --- +int(-3) +--- testing: -2147483649 % 9 --- +int(-3) +--- testing: -2147483649 % 65 --- +int(-64) +--- testing: -2147483649 % -44 --- +int(-25) +--- testing: -2147483649 % 2147483647 --- +int(-2) +--- testing: -2147483649 % 9223372036854775807 --- +int(-2147483649) +--- testing: 4294967294 % 0 --- +bool(false) +--- testing: 4294967294 % 1 --- +int(0) +--- testing: 4294967294 % -1 --- +int(0) +--- testing: 4294967294 % 7 --- +int(2) +--- testing: 4294967294 % 9 --- +int(2) +--- testing: 4294967294 % 65 --- +int(59) +--- testing: 4294967294 % -44 --- +int(2) +--- testing: 4294967294 % 2147483647 --- +int(0) +--- testing: 4294967294 % 9223372036854775807 --- +int(4294967294) +--- testing: 4294967295 % 0 --- +bool(false) +--- testing: 4294967295 % 1 --- +int(0) +--- testing: 4294967295 % -1 --- +int(0) +--- testing: 4294967295 % 7 --- +int(3) +--- testing: 4294967295 % 9 --- +int(3) +--- testing: 4294967295 % 65 --- +int(60) +--- testing: 4294967295 % -44 --- +int(3) +--- testing: 4294967295 % 2147483647 --- +int(1) +--- testing: 4294967295 % 9223372036854775807 --- +int(4294967295) +--- testing: 4294967293 % 0 --- +bool(false) +--- testing: 4294967293 % 1 --- +int(0) +--- testing: 4294967293 % -1 --- +int(0) +--- testing: 4294967293 % 7 --- +int(1) +--- testing: 4294967293 % 9 --- +int(1) +--- testing: 4294967293 % 65 --- +int(58) +--- testing: 4294967293 % -44 --- +int(1) +--- testing: 4294967293 % 2147483647 --- +int(2147483646) +--- testing: 4294967293 % 9223372036854775807 --- +int(4294967293) +--- testing: 9223372036854775806 % 0 --- +bool(false) +--- testing: 9223372036854775806 % 1 --- +int(0) +--- testing: 9223372036854775806 % -1 --- +int(0) +--- testing: 9223372036854775806 % 7 --- +int(6) +--- testing: 9223372036854775806 % 9 --- +int(6) +--- testing: 9223372036854775806 % 65 --- +int(6) +--- testing: 9223372036854775806 % -44 --- +int(6) +--- testing: 9223372036854775806 % 2147483647 --- +int(0) +--- testing: 9223372036854775806 % 9223372036854775807 --- +int(9223372036854775806) +--- testing: 9.2233720368548E+18 % 0 --- +bool(false) +--- testing: 9.2233720368548E+18 % 1 --- +int(0) +--- testing: 9.2233720368548E+18 % -1 --- +int(0) +--- testing: 9.2233720368548E+18 % 7 --- +int(-1) +--- testing: 9.2233720368548E+18 % 9 --- +int(-8) +--- testing: 9.2233720368548E+18 % 65 --- +int(-8) +--- testing: 9.2233720368548E+18 % -44 --- +int(-8) +--- testing: 9.2233720368548E+18 % 2147483647 --- +int(-2) +--- testing: 9.2233720368548E+18 % 9223372036854775807 --- +int(-1) +--- testing: -9223372036854775807 % 0 --- +bool(false) +--- testing: -9223372036854775807 % 1 --- +int(0) +--- testing: -9223372036854775807 % -1 --- +int(0) +--- testing: -9223372036854775807 % 7 --- +int(0) +--- testing: -9223372036854775807 % 9 --- +int(-7) +--- testing: -9223372036854775807 % 65 --- +int(-7) +--- testing: -9223372036854775807 % -44 --- +int(-7) +--- testing: -9223372036854775807 % 2147483647 --- +int(-1) +--- testing: -9223372036854775807 % 9223372036854775807 --- +int(0) +--- testing: -9.2233720368548E+18 % 0 --- +bool(false) +--- testing: -9.2233720368548E+18 % 1 --- +int(0) +--- testing: -9.2233720368548E+18 % -1 --- +int(0) +--- testing: -9.2233720368548E+18 % 7 --- +int(-1) +--- testing: -9.2233720368548E+18 % 9 --- +int(-8) +--- testing: -9.2233720368548E+18 % 65 --- +int(-8) +--- testing: -9.2233720368548E+18 % -44 --- +int(-8) +--- testing: -9.2233720368548E+18 % 2147483647 --- +int(-2) +--- testing: -9.2233720368548E+18 % 9223372036854775807 --- +int(-1) +--- testing: 0 % 9223372036854775807 --- +int(0) +--- testing: 0 % -9223372036854775808 --- +int(0) +--- testing: 0 % 2147483647 --- +int(0) +--- testing: 0 % -2147483648 --- +int(0) +--- testing: 0 % 9223372034707292160 --- +int(0) +--- testing: 0 % -9223372034707292160 --- +int(0) +--- testing: 0 % 2147483648 --- +int(0) +--- testing: 0 % -2147483649 --- +int(0) +--- testing: 0 % 4294967294 --- +int(0) +--- testing: 0 % 4294967295 --- +int(0) +--- testing: 0 % 4294967293 --- +int(0) +--- testing: 0 % 9223372036854775806 --- +int(0) +--- testing: 0 % 9.2233720368548E+18 --- +int(0) +--- testing: 0 % -9223372036854775807 --- +int(0) +--- testing: 0 % -9.2233720368548E+18 --- +int(0) +--- testing: 1 % 9223372036854775807 --- +int(1) +--- testing: 1 % -9223372036854775808 --- +int(1) +--- testing: 1 % 2147483647 --- +int(1) +--- testing: 1 % -2147483648 --- +int(1) +--- testing: 1 % 9223372034707292160 --- +int(1) +--- testing: 1 % -9223372034707292160 --- +int(1) +--- testing: 1 % 2147483648 --- +int(1) +--- testing: 1 % -2147483649 --- +int(1) +--- testing: 1 % 4294967294 --- +int(1) +--- testing: 1 % 4294967295 --- +int(1) +--- testing: 1 % 4294967293 --- +int(1) +--- testing: 1 % 9223372036854775806 --- +int(1) +--- testing: 1 % 9.2233720368548E+18 --- +int(1) +--- testing: 1 % -9223372036854775807 --- +int(1) +--- testing: 1 % -9.2233720368548E+18 --- +int(1) +--- testing: -1 % 9223372036854775807 --- +int(-1) +--- testing: -1 % -9223372036854775808 --- +int(-1) +--- testing: -1 % 2147483647 --- +int(-1) +--- testing: -1 % -2147483648 --- +int(-1) +--- testing: -1 % 9223372034707292160 --- +int(-1) +--- testing: -1 % -9223372034707292160 --- +int(-1) +--- testing: -1 % 2147483648 --- +int(-1) +--- testing: -1 % -2147483649 --- +int(-1) +--- testing: -1 % 4294967294 --- +int(-1) +--- testing: -1 % 4294967295 --- +int(-1) +--- testing: -1 % 4294967293 --- +int(-1) +--- testing: -1 % 9223372036854775806 --- +int(-1) +--- testing: -1 % 9.2233720368548E+18 --- +int(-1) +--- testing: -1 % -9223372036854775807 --- +int(-1) +--- testing: -1 % -9.2233720368548E+18 --- +int(-1) +--- testing: 7 % 9223372036854775807 --- +int(7) +--- testing: 7 % -9223372036854775808 --- +int(7) +--- testing: 7 % 2147483647 --- +int(7) +--- testing: 7 % -2147483648 --- +int(7) +--- testing: 7 % 9223372034707292160 --- +int(7) +--- testing: 7 % -9223372034707292160 --- +int(7) +--- testing: 7 % 2147483648 --- +int(7) +--- testing: 7 % -2147483649 --- +int(7) +--- testing: 7 % 4294967294 --- +int(7) +--- testing: 7 % 4294967295 --- +int(7) +--- testing: 7 % 4294967293 --- +int(7) +--- testing: 7 % 9223372036854775806 --- +int(7) +--- testing: 7 % 9.2233720368548E+18 --- +int(7) +--- testing: 7 % -9223372036854775807 --- +int(7) +--- testing: 7 % -9.2233720368548E+18 --- +int(7) +--- testing: 9 % 9223372036854775807 --- +int(9) +--- testing: 9 % -9223372036854775808 --- +int(9) +--- testing: 9 % 2147483647 --- +int(9) +--- testing: 9 % -2147483648 --- +int(9) +--- testing: 9 % 9223372034707292160 --- +int(9) +--- testing: 9 % -9223372034707292160 --- +int(9) +--- testing: 9 % 2147483648 --- +int(9) +--- testing: 9 % -2147483649 --- +int(9) +--- testing: 9 % 4294967294 --- +int(9) +--- testing: 9 % 4294967295 --- +int(9) +--- testing: 9 % 4294967293 --- +int(9) +--- testing: 9 % 9223372036854775806 --- +int(9) +--- testing: 9 % 9.2233720368548E+18 --- +int(9) +--- testing: 9 % -9223372036854775807 --- +int(9) +--- testing: 9 % -9.2233720368548E+18 --- +int(9) +--- testing: 65 % 9223372036854775807 --- +int(65) +--- testing: 65 % -9223372036854775808 --- +int(65) +--- testing: 65 % 2147483647 --- +int(65) +--- testing: 65 % -2147483648 --- +int(65) +--- testing: 65 % 9223372034707292160 --- +int(65) +--- testing: 65 % -9223372034707292160 --- +int(65) +--- testing: 65 % 2147483648 --- +int(65) +--- testing: 65 % -2147483649 --- +int(65) +--- testing: 65 % 4294967294 --- +int(65) +--- testing: 65 % 4294967295 --- +int(65) +--- testing: 65 % 4294967293 --- +int(65) +--- testing: 65 % 9223372036854775806 --- +int(65) +--- testing: 65 % 9.2233720368548E+18 --- +int(65) +--- testing: 65 % -9223372036854775807 --- +int(65) +--- testing: 65 % -9.2233720368548E+18 --- +int(65) +--- testing: -44 % 9223372036854775807 --- +int(-44) +--- testing: -44 % -9223372036854775808 --- +int(-44) +--- testing: -44 % 2147483647 --- +int(-44) +--- testing: -44 % -2147483648 --- +int(-44) +--- testing: -44 % 9223372034707292160 --- +int(-44) +--- testing: -44 % -9223372034707292160 --- +int(-44) +--- testing: -44 % 2147483648 --- +int(-44) +--- testing: -44 % -2147483649 --- +int(-44) +--- testing: -44 % 4294967294 --- +int(-44) +--- testing: -44 % 4294967295 --- +int(-44) +--- testing: -44 % 4294967293 --- +int(-44) +--- testing: -44 % 9223372036854775806 --- +int(-44) +--- testing: -44 % 9.2233720368548E+18 --- +int(-44) +--- testing: -44 % -9223372036854775807 --- +int(-44) +--- testing: -44 % -9.2233720368548E+18 --- +int(-44) +--- testing: 2147483647 % 9223372036854775807 --- +int(2147483647) +--- testing: 2147483647 % -9223372036854775808 --- +int(2147483647) +--- testing: 2147483647 % 2147483647 --- +int(0) +--- testing: 2147483647 % -2147483648 --- +int(2147483647) +--- testing: 2147483647 % 9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 % -9223372034707292160 --- +int(2147483647) +--- testing: 2147483647 % 2147483648 --- +int(2147483647) +--- testing: 2147483647 % -2147483649 --- +int(2147483647) +--- testing: 2147483647 % 4294967294 --- +int(2147483647) +--- testing: 2147483647 % 4294967295 --- +int(2147483647) +--- testing: 2147483647 % 4294967293 --- +int(2147483647) +--- testing: 2147483647 % 9223372036854775806 --- +int(2147483647) +--- testing: 2147483647 % 9.2233720368548E+18 --- +int(2147483647) +--- testing: 2147483647 % -9223372036854775807 --- +int(2147483647) +--- testing: 2147483647 % -9.2233720368548E+18 --- +int(2147483647) +--- testing: 9223372036854775807 % 9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 % -9223372036854775808 --- +int(9223372036854775807) +--- testing: 9223372036854775807 % 2147483647 --- +int(1) +--- testing: 9223372036854775807 % -2147483648 --- +int(2147483647) +--- testing: 9223372036854775807 % 9223372034707292160 --- +int(2147483647) +--- testing: 9223372036854775807 % -9223372034707292160 --- +int(2147483647) +--- testing: 9223372036854775807 % 2147483648 --- +int(2147483647) +--- testing: 9223372036854775807 % -2147483649 --- +int(1) +--- testing: 9223372036854775807 % 4294967294 --- +int(1) +--- testing: 9223372036854775807 % 4294967295 --- +int(2147483647) +--- testing: 9223372036854775807 % 4294967293 --- +int(2147483650) +--- testing: 9223372036854775807 % 9223372036854775806 --- +int(1) +--- testing: 9223372036854775807 % 9.2233720368548E+18 --- +int(9223372036854775807) +--- testing: 9223372036854775807 % -9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 % -9.2233720368548E+18 --- +int(9223372036854775807) +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt new file mode 100644 index 0000000..7b3ce76 --- /dev/null +++ b/tests/lang/operators/modulus_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test % operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' % '0' --- +bool(false) +--- testing: '0' % '65' --- +int(0) +--- testing: '0' % '-44' --- +int(0) +--- testing: '0' % '1.2' --- +int(0) +--- testing: '0' % '-7.7' --- +int(0) +--- testing: '0' % 'abc' --- +bool(false) +--- testing: '0' % '123abc' --- +int(0) +--- testing: '0' % '123e5' --- +int(0) +--- testing: '0' % '123e5xyz' --- +int(0) +--- testing: '0' % ' 123abc' --- +int(0) +--- testing: '0' % '123 abc' --- +int(0) +--- testing: '0' % '123abc ' --- +int(0) +--- testing: '0' % '3.4a' --- +int(0) +--- testing: '0' % 'a5.9' --- +bool(false) +--- testing: '65' % '0' --- +bool(false) +--- testing: '65' % '65' --- +int(0) +--- testing: '65' % '-44' --- +int(21) +--- testing: '65' % '1.2' --- +int(0) +--- testing: '65' % '-7.7' --- +int(2) +--- testing: '65' % 'abc' --- +bool(false) +--- testing: '65' % '123abc' --- +int(65) +--- testing: '65' % '123e5' --- +int(65) +--- testing: '65' % '123e5xyz' --- +int(65) +--- testing: '65' % ' 123abc' --- +int(65) +--- testing: '65' % '123 abc' --- +int(65) +--- testing: '65' % '123abc ' --- +int(65) +--- testing: '65' % '3.4a' --- +int(2) +--- testing: '65' % 'a5.9' --- +bool(false) +--- testing: '-44' % '0' --- +bool(false) +--- testing: '-44' % '65' --- +int(-44) +--- testing: '-44' % '-44' --- +int(0) +--- testing: '-44' % '1.2' --- +int(0) +--- testing: '-44' % '-7.7' --- +int(-2) +--- testing: '-44' % 'abc' --- +bool(false) +--- testing: '-44' % '123abc' --- +int(-44) +--- testing: '-44' % '123e5' --- +int(-44) +--- testing: '-44' % '123e5xyz' --- +int(-44) +--- testing: '-44' % ' 123abc' --- +int(-44) +--- testing: '-44' % '123 abc' --- +int(-44) +--- testing: '-44' % '123abc ' --- +int(-44) +--- testing: '-44' % '3.4a' --- +int(-2) +--- testing: '-44' % 'a5.9' --- +bool(false) +--- testing: '1.2' % '0' --- +bool(false) +--- testing: '1.2' % '65' --- +int(1) +--- testing: '1.2' % '-44' --- +int(1) +--- testing: '1.2' % '1.2' --- +int(0) +--- testing: '1.2' % '-7.7' --- +int(1) +--- testing: '1.2' % 'abc' --- +bool(false) +--- testing: '1.2' % '123abc' --- +int(1) +--- testing: '1.2' % '123e5' --- +int(1) +--- testing: '1.2' % '123e5xyz' --- +int(1) +--- testing: '1.2' % ' 123abc' --- +int(1) +--- testing: '1.2' % '123 abc' --- +int(1) +--- testing: '1.2' % '123abc ' --- +int(1) +--- testing: '1.2' % '3.4a' --- +int(1) +--- testing: '1.2' % 'a5.9' --- +bool(false) +--- testing: '-7.7' % '0' --- +bool(false) +--- testing: '-7.7' % '65' --- +int(-7) +--- testing: '-7.7' % '-44' --- +int(-7) +--- testing: '-7.7' % '1.2' --- +int(0) +--- testing: '-7.7' % '-7.7' --- +int(0) +--- testing: '-7.7' % 'abc' --- +bool(false) +--- testing: '-7.7' % '123abc' --- +int(-7) +--- testing: '-7.7' % '123e5' --- +int(-7) +--- testing: '-7.7' % '123e5xyz' --- +int(-7) +--- testing: '-7.7' % ' 123abc' --- +int(-7) +--- testing: '-7.7' % '123 abc' --- +int(-7) +--- testing: '-7.7' % '123abc ' --- +int(-7) +--- testing: '-7.7' % '3.4a' --- +int(-1) +--- testing: '-7.7' % 'a5.9' --- +bool(false) +--- testing: 'abc' % '0' --- +bool(false) +--- testing: 'abc' % '65' --- +int(0) +--- testing: 'abc' % '-44' --- +int(0) +--- testing: 'abc' % '1.2' --- +int(0) +--- testing: 'abc' % '-7.7' --- +int(0) +--- testing: 'abc' % 'abc' --- +bool(false) +--- testing: 'abc' % '123abc' --- +int(0) +--- testing: 'abc' % '123e5' --- +int(0) +--- testing: 'abc' % '123e5xyz' --- +int(0) +--- testing: 'abc' % ' 123abc' --- +int(0) +--- testing: 'abc' % '123 abc' --- +int(0) +--- testing: 'abc' % '123abc ' --- +int(0) +--- testing: 'abc' % '3.4a' --- +int(0) +--- testing: 'abc' % 'a5.9' --- +bool(false) +--- testing: '123abc' % '0' --- +bool(false) +--- testing: '123abc' % '65' --- +int(58) +--- testing: '123abc' % '-44' --- +int(35) +--- testing: '123abc' % '1.2' --- +int(0) +--- testing: '123abc' % '-7.7' --- +int(4) +--- testing: '123abc' % 'abc' --- +bool(false) +--- testing: '123abc' % '123abc' --- +int(0) +--- testing: '123abc' % '123e5' --- +int(0) +--- testing: '123abc' % '123e5xyz' --- +int(0) +--- testing: '123abc' % ' 123abc' --- +int(0) +--- testing: '123abc' % '123 abc' --- +int(0) +--- testing: '123abc' % '123abc ' --- +int(0) +--- testing: '123abc' % '3.4a' --- +int(0) +--- testing: '123abc' % 'a5.9' --- +bool(false) +--- testing: '123e5' % '0' --- +bool(false) +--- testing: '123e5' % '65' --- +int(58) +--- testing: '123e5' % '-44' --- +int(35) +--- testing: '123e5' % '1.2' --- +int(0) +--- testing: '123e5' % '-7.7' --- +int(4) +--- testing: '123e5' % 'abc' --- +bool(false) +--- testing: '123e5' % '123abc' --- +int(0) +--- testing: '123e5' % '123e5' --- +int(0) +--- testing: '123e5' % '123e5xyz' --- +int(0) +--- testing: '123e5' % ' 123abc' --- +int(0) +--- testing: '123e5' % '123 abc' --- +int(0) +--- testing: '123e5' % '123abc ' --- +int(0) +--- testing: '123e5' % '3.4a' --- +int(0) +--- testing: '123e5' % 'a5.9' --- +bool(false) +--- testing: '123e5xyz' % '0' --- +bool(false) +--- testing: '123e5xyz' % '65' --- +int(58) +--- testing: '123e5xyz' % '-44' --- +int(35) +--- testing: '123e5xyz' % '1.2' --- +int(0) +--- testing: '123e5xyz' % '-7.7' --- +int(4) +--- testing: '123e5xyz' % 'abc' --- +bool(false) +--- testing: '123e5xyz' % '123abc' --- +int(0) +--- testing: '123e5xyz' % '123e5' --- +int(0) +--- testing: '123e5xyz' % '123e5xyz' --- +int(0) +--- testing: '123e5xyz' % ' 123abc' --- +int(0) +--- testing: '123e5xyz' % '123 abc' --- +int(0) +--- testing: '123e5xyz' % '123abc ' --- +int(0) +--- testing: '123e5xyz' % '3.4a' --- +int(0) +--- testing: '123e5xyz' % 'a5.9' --- +bool(false) +--- testing: ' 123abc' % '0' --- +bool(false) +--- testing: ' 123abc' % '65' --- +int(58) +--- testing: ' 123abc' % '-44' --- +int(35) +--- testing: ' 123abc' % '1.2' --- +int(0) +--- testing: ' 123abc' % '-7.7' --- +int(4) +--- testing: ' 123abc' % 'abc' --- +bool(false) +--- testing: ' 123abc' % '123abc' --- +int(0) +--- testing: ' 123abc' % '123e5' --- +int(0) +--- testing: ' 123abc' % '123e5xyz' --- +int(0) +--- testing: ' 123abc' % ' 123abc' --- +int(0) +--- testing: ' 123abc' % '123 abc' --- +int(0) +--- testing: ' 123abc' % '123abc ' --- +int(0) +--- testing: ' 123abc' % '3.4a' --- +int(0) +--- testing: ' 123abc' % 'a5.9' --- +bool(false) +--- testing: '123 abc' % '0' --- +bool(false) +--- testing: '123 abc' % '65' --- +int(58) +--- testing: '123 abc' % '-44' --- +int(35) +--- testing: '123 abc' % '1.2' --- +int(0) +--- testing: '123 abc' % '-7.7' --- +int(4) +--- testing: '123 abc' % 'abc' --- +bool(false) +--- testing: '123 abc' % '123abc' --- +int(0) +--- testing: '123 abc' % '123e5' --- +int(0) +--- testing: '123 abc' % '123e5xyz' --- +int(0) +--- testing: '123 abc' % ' 123abc' --- +int(0) +--- testing: '123 abc' % '123 abc' --- +int(0) +--- testing: '123 abc' % '123abc ' --- +int(0) +--- testing: '123 abc' % '3.4a' --- +int(0) +--- testing: '123 abc' % 'a5.9' --- +bool(false) +--- testing: '123abc ' % '0' --- +bool(false) +--- testing: '123abc ' % '65' --- +int(58) +--- testing: '123abc ' % '-44' --- +int(35) +--- testing: '123abc ' % '1.2' --- +int(0) +--- testing: '123abc ' % '-7.7' --- +int(4) +--- testing: '123abc ' % 'abc' --- +bool(false) +--- testing: '123abc ' % '123abc' --- +int(0) +--- testing: '123abc ' % '123e5' --- +int(0) +--- testing: '123abc ' % '123e5xyz' --- +int(0) +--- testing: '123abc ' % ' 123abc' --- +int(0) +--- testing: '123abc ' % '123 abc' --- +int(0) +--- testing: '123abc ' % '123abc ' --- +int(0) +--- testing: '123abc ' % '3.4a' --- +int(0) +--- testing: '123abc ' % 'a5.9' --- +bool(false) +--- testing: '3.4a' % '0' --- +bool(false) +--- testing: '3.4a' % '65' --- +int(3) +--- testing: '3.4a' % '-44' --- +int(3) +--- testing: '3.4a' % '1.2' --- +int(0) +--- testing: '3.4a' % '-7.7' --- +int(3) +--- testing: '3.4a' % 'abc' --- +bool(false) +--- testing: '3.4a' % '123abc' --- +int(3) +--- testing: '3.4a' % '123e5' --- +int(3) +--- testing: '3.4a' % '123e5xyz' --- +int(3) +--- testing: '3.4a' % ' 123abc' --- +int(3) +--- testing: '3.4a' % '123 abc' --- +int(3) +--- testing: '3.4a' % '123abc ' --- +int(3) +--- testing: '3.4a' % '3.4a' --- +int(0) +--- testing: '3.4a' % 'a5.9' --- +bool(false) +--- testing: 'a5.9' % '0' --- +bool(false) +--- testing: 'a5.9' % '65' --- +int(0) +--- testing: 'a5.9' % '-44' --- +int(0) +--- testing: 'a5.9' % '1.2' --- +int(0) +--- testing: 'a5.9' % '-7.7' --- +int(0) +--- testing: 'a5.9' % 'abc' --- +bool(false) +--- testing: 'a5.9' % '123abc' --- +int(0) +--- testing: 'a5.9' % '123e5' --- +int(0) +--- testing: 'a5.9' % '123e5xyz' --- +int(0) +--- testing: 'a5.9' % ' 123abc' --- +int(0) +--- testing: 'a5.9' % '123 abc' --- +int(0) +--- testing: 'a5.9' % '123abc ' --- +int(0) +--- testing: 'a5.9' % '3.4a' --- +int(0) +--- testing: 'a5.9' % 'a5.9' --- +bool(false) +===DONE=== diff --git a/tests/lang/operators/multiply_basiclong_64bit.phpt b/tests/lang/operators/multiply_basiclong_64bit.phpt new file mode 100644 index 0000000..4c7077b --- /dev/null +++ b/tests/lang/operators/multiply_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test * operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 * 0 --- +int(0) +--- testing: 9223372036854775807 * 1 --- +int(9223372036854775807) +--- testing: 9223372036854775807 * -1 --- +int(-9223372036854775807) +--- testing: 9223372036854775807 * 7 --- +float(6.4563604257983E+19) +--- testing: 9223372036854775807 * 9 --- +float(8.3010348331693E+19) +--- testing: 9223372036854775807 * 65 --- +float(5.9951918239556E+20) +--- testing: 9223372036854775807 * -44 --- +float(-4.0582836962161E+20) +--- testing: 9223372036854775807 * 2147483647 --- +float(1.9807040619343E+28) +--- testing: 9223372036854775807 * 9223372036854775807 --- +float(8.5070591730235E+37) +--- testing: -9223372036854775808 * 0 --- +int(0) +--- testing: -9223372036854775808 * 1 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 * -1 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775808 * 7 --- +float(-6.4563604257983E+19) +--- testing: -9223372036854775808 * 9 --- +float(-8.3010348331693E+19) +--- testing: -9223372036854775808 * 65 --- +float(-5.9951918239556E+20) +--- testing: -9223372036854775808 * -44 --- +float(4.0582836962161E+20) +--- testing: -9223372036854775808 * 2147483647 --- +float(-1.9807040619343E+28) +--- testing: -9223372036854775808 * 9223372036854775807 --- +float(-8.5070591730235E+37) +--- testing: 2147483647 * 0 --- +int(0) +--- testing: 2147483647 * 1 --- +int(2147483647) +--- testing: 2147483647 * -1 --- +int(-2147483647) +--- testing: 2147483647 * 7 --- +int(15032385529) +--- testing: 2147483647 * 9 --- +int(19327352823) +--- testing: 2147483647 * 65 --- +int(139586437055) +--- testing: 2147483647 * -44 --- +int(-94489280468) +--- testing: 2147483647 * 2147483647 --- +int(4611686014132420609) +--- testing: 2147483647 * 9223372036854775807 --- +float(1.9807040619343E+28) +--- testing: -2147483648 * 0 --- +int(0) +--- testing: -2147483648 * 1 --- +int(-2147483648) +--- testing: -2147483648 * -1 --- +int(2147483648) +--- testing: -2147483648 * 7 --- +int(-15032385536) +--- testing: -2147483648 * 9 --- +int(-19327352832) +--- testing: -2147483648 * 65 --- +int(-139586437120) +--- testing: -2147483648 * -44 --- +int(94489280512) +--- testing: -2147483648 * 2147483647 --- +int(-4611686016279904256) +--- testing: -2147483648 * 9223372036854775807 --- +float(-1.9807040628566E+28) +--- testing: 9223372034707292160 * 0 --- +int(0) +--- testing: 9223372034707292160 * 1 --- +int(9223372034707292160) +--- testing: 9223372034707292160 * -1 --- +int(-9223372034707292160) +--- testing: 9223372034707292160 * 7 --- +float(6.4563604242951E+19) +--- testing: 9223372034707292160 * 9 --- +float(8.3010348312366E+19) +--- testing: 9223372034707292160 * 65 --- +float(5.9951918225597E+20) +--- testing: 9223372034707292160 * -44 --- +float(-4.0582836952712E+20) +--- testing: 9223372034707292160 * 2147483647 --- +float(1.9807040614731E+28) +--- testing: 9223372034707292160 * 9223372036854775807 --- +float(8.5070591710428E+37) +--- testing: -9223372034707292160 * 0 --- +int(0) +--- testing: -9223372034707292160 * 1 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 * -1 --- +int(9223372034707292160) +--- testing: -9223372034707292160 * 7 --- +float(-6.4563604242951E+19) +--- testing: -9223372034707292160 * 9 --- +float(-8.3010348312366E+19) +--- testing: -9223372034707292160 * 65 --- +float(-5.9951918225597E+20) +--- testing: -9223372034707292160 * -44 --- +float(4.0582836952712E+20) +--- testing: -9223372034707292160 * 2147483647 --- +float(-1.9807040614731E+28) +--- testing: -9223372034707292160 * 9223372036854775807 --- +float(-8.5070591710428E+37) +--- testing: 2147483648 * 0 --- +int(0) +--- testing: 2147483648 * 1 --- +int(2147483648) +--- testing: 2147483648 * -1 --- +int(-2147483648) +--- testing: 2147483648 * 7 --- +int(15032385536) +--- testing: 2147483648 * 9 --- +int(19327352832) +--- testing: 2147483648 * 65 --- +int(139586437120) +--- testing: 2147483648 * -44 --- +int(-94489280512) +--- testing: 2147483648 * 2147483647 --- +int(4611686016279904256) +--- testing: 2147483648 * 9223372036854775807 --- +float(1.9807040628566E+28) +--- testing: -2147483649 * 0 --- +int(0) +--- testing: -2147483649 * 1 --- +int(-2147483649) +--- testing: -2147483649 * -1 --- +int(2147483649) +--- testing: -2147483649 * 7 --- +int(-15032385543) +--- testing: -2147483649 * 9 --- +int(-19327352841) +--- testing: -2147483649 * 65 --- +int(-139586437185) +--- testing: -2147483649 * -44 --- +int(94489280556) +--- testing: -2147483649 * 2147483647 --- +int(-4611686018427387903) +--- testing: -2147483649 * 9223372036854775807 --- +float(-1.9807040637789E+28) +--- testing: 4294967294 * 0 --- +int(0) +--- testing: 4294967294 * 1 --- +int(4294967294) +--- testing: 4294967294 * -1 --- +int(-4294967294) +--- testing: 4294967294 * 7 --- +int(30064771058) +--- testing: 4294967294 * 9 --- +int(38654705646) +--- testing: 4294967294 * 65 --- +int(279172874110) +--- testing: 4294967294 * -44 --- +int(-188978560936) +--- testing: 4294967294 * 2147483647 --- +int(9223372028264841218) +--- testing: 4294967294 * 9223372036854775807 --- +float(3.9614081238685E+28) +--- testing: 4294967295 * 0 --- +int(0) +--- testing: 4294967295 * 1 --- +int(4294967295) +--- testing: 4294967295 * -1 --- +int(-4294967295) +--- testing: 4294967295 * 7 --- +int(30064771065) +--- testing: 4294967295 * 9 --- +int(38654705655) +--- testing: 4294967295 * 65 --- +int(279172874175) +--- testing: 4294967295 * -44 --- +int(-188978560980) +--- testing: 4294967295 * 2147483647 --- +int(9223372030412324865) +--- testing: 4294967295 * 9223372036854775807 --- +float(3.9614081247909E+28) +--- testing: 4294967293 * 0 --- +int(0) +--- testing: 4294967293 * 1 --- +int(4294967293) +--- testing: 4294967293 * -1 --- +int(-4294967293) +--- testing: 4294967293 * 7 --- +int(30064771051) +--- testing: 4294967293 * 9 --- +int(38654705637) +--- testing: 4294967293 * 65 --- +int(279172874045) +--- testing: 4294967293 * -44 --- +int(-188978560892) +--- testing: 4294967293 * 2147483647 --- +int(9223372026117357571) +--- testing: 4294967293 * 9223372036854775807 --- +float(3.9614081229462E+28) +--- testing: 9223372036854775806 * 0 --- +int(0) +--- testing: 9223372036854775806 * 1 --- +int(9223372036854775806) +--- testing: 9223372036854775806 * -1 --- +int(-9223372036854775806) +--- testing: 9223372036854775806 * 7 --- +float(6.4563604257983E+19) +--- testing: 9223372036854775806 * 9 --- +float(8.3010348331693E+19) +--- testing: 9223372036854775806 * 65 --- +float(5.9951918239556E+20) +--- testing: 9223372036854775806 * -44 --- +float(-4.0582836962161E+20) +--- testing: 9223372036854775806 * 2147483647 --- +float(1.9807040619343E+28) +--- testing: 9223372036854775806 * 9223372036854775807 --- +float(8.5070591730235E+37) +--- testing: 9.2233720368548E+18 * 0 --- +float(0) +--- testing: 9.2233720368548E+18 * 1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 * -1 --- +float(-9.2233720368548E+18) +--- testing: 9.2233720368548E+18 * 7 --- +float(6.4563604257983E+19) +--- testing: 9.2233720368548E+18 * 9 --- +float(8.3010348331693E+19) +--- testing: 9.2233720368548E+18 * 65 --- +float(5.9951918239556E+20) +--- testing: 9.2233720368548E+18 * -44 --- +float(-4.0582836962161E+20) +--- testing: 9.2233720368548E+18 * 2147483647 --- +float(1.9807040619343E+28) +--- testing: 9.2233720368548E+18 * 9223372036854775807 --- +float(8.5070591730235E+37) +--- testing: -9223372036854775807 * 0 --- +int(0) +--- testing: -9223372036854775807 * 1 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 * -1 --- +int(9223372036854775807) +--- testing: -9223372036854775807 * 7 --- +float(-6.4563604257983E+19) +--- testing: -9223372036854775807 * 9 --- +float(-8.3010348331693E+19) +--- testing: -9223372036854775807 * 65 --- +float(-5.9951918239556E+20) +--- testing: -9223372036854775807 * -44 --- +float(4.0582836962161E+20) +--- testing: -9223372036854775807 * 2147483647 --- +float(-1.9807040619343E+28) +--- testing: -9223372036854775807 * 9223372036854775807 --- +float(-8.5070591730235E+37) +--- testing: -9.2233720368548E+18 * 0 --- +float(-0) +--- testing: -9.2233720368548E+18 * 1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 * -1 --- +float(9.2233720368548E+18) +--- testing: -9.2233720368548E+18 * 7 --- +float(-6.4563604257983E+19) +--- testing: -9.2233720368548E+18 * 9 --- +float(-8.3010348331693E+19) +--- testing: -9.2233720368548E+18 * 65 --- +float(-5.9951918239556E+20) +--- testing: -9.2233720368548E+18 * -44 --- +float(4.0582836962161E+20) +--- testing: -9.2233720368548E+18 * 2147483647 --- +float(-1.9807040619343E+28) +--- testing: -9.2233720368548E+18 * 9223372036854775807 --- +float(-8.5070591730235E+37) +--- testing: 0 * 9223372036854775807 --- +int(0) +--- testing: 0 * -9223372036854775808 --- +int(0) +--- testing: 0 * 2147483647 --- +int(0) +--- testing: 0 * -2147483648 --- +int(0) +--- testing: 0 * 9223372034707292160 --- +int(0) +--- testing: 0 * -9223372034707292160 --- +int(0) +--- testing: 0 * 2147483648 --- +int(0) +--- testing: 0 * -2147483649 --- +int(0) +--- testing: 0 * 4294967294 --- +int(0) +--- testing: 0 * 4294967295 --- +int(0) +--- testing: 0 * 4294967293 --- +int(0) +--- testing: 0 * 9223372036854775806 --- +int(0) +--- testing: 0 * 9.2233720368548E+18 --- +float(0) +--- testing: 0 * -9223372036854775807 --- +int(0) +--- testing: 0 * -9.2233720368548E+18 --- +float(-0) +--- testing: 1 * 9223372036854775807 --- +int(9223372036854775807) +--- testing: 1 * -9223372036854775808 --- +int(-9223372036854775808) +--- testing: 1 * 2147483647 --- +int(2147483647) +--- testing: 1 * -2147483648 --- +int(-2147483648) +--- testing: 1 * 9223372034707292160 --- +int(9223372034707292160) +--- testing: 1 * -9223372034707292160 --- +int(-9223372034707292160) +--- testing: 1 * 2147483648 --- +int(2147483648) +--- testing: 1 * -2147483649 --- +int(-2147483649) +--- testing: 1 * 4294967294 --- +int(4294967294) +--- testing: 1 * 4294967295 --- +int(4294967295) +--- testing: 1 * 4294967293 --- +int(4294967293) +--- testing: 1 * 9223372036854775806 --- +int(9223372036854775806) +--- testing: 1 * 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 1 * -9223372036854775807 --- +int(-9223372036854775807) +--- testing: 1 * -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -1 * 9223372036854775807 --- +int(-9223372036854775807) +--- testing: -1 * -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: -1 * 2147483647 --- +int(-2147483647) +--- testing: -1 * -2147483648 --- +int(2147483648) +--- testing: -1 * 9223372034707292160 --- +int(-9223372034707292160) +--- testing: -1 * -9223372034707292160 --- +int(9223372034707292160) +--- testing: -1 * 2147483648 --- +int(-2147483648) +--- testing: -1 * -2147483649 --- +int(2147483649) +--- testing: -1 * 4294967294 --- +int(-4294967294) +--- testing: -1 * 4294967295 --- +int(-4294967295) +--- testing: -1 * 4294967293 --- +int(-4294967293) +--- testing: -1 * 9223372036854775806 --- +int(-9223372036854775806) +--- testing: -1 * 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -1 * -9223372036854775807 --- +int(9223372036854775807) +--- testing: -1 * -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 7 * 9223372036854775807 --- +float(6.4563604257983E+19) +--- testing: 7 * -9223372036854775808 --- +float(-6.4563604257983E+19) +--- testing: 7 * 2147483647 --- +int(15032385529) +--- testing: 7 * -2147483648 --- +int(-15032385536) +--- testing: 7 * 9223372034707292160 --- +float(6.4563604242951E+19) +--- testing: 7 * -9223372034707292160 --- +float(-6.4563604242951E+19) +--- testing: 7 * 2147483648 --- +int(15032385536) +--- testing: 7 * -2147483649 --- +int(-15032385543) +--- testing: 7 * 4294967294 --- +int(30064771058) +--- testing: 7 * 4294967295 --- +int(30064771065) +--- testing: 7 * 4294967293 --- +int(30064771051) +--- testing: 7 * 9223372036854775806 --- +float(6.4563604257983E+19) +--- testing: 7 * 9.2233720368548E+18 --- +float(6.4563604257983E+19) +--- testing: 7 * -9223372036854775807 --- +float(-6.4563604257983E+19) +--- testing: 7 * -9.2233720368548E+18 --- +float(-6.4563604257983E+19) +--- testing: 9 * 9223372036854775807 --- +float(8.3010348331693E+19) +--- testing: 9 * -9223372036854775808 --- +float(-8.3010348331693E+19) +--- testing: 9 * 2147483647 --- +int(19327352823) +--- testing: 9 * -2147483648 --- +int(-19327352832) +--- testing: 9 * 9223372034707292160 --- +float(8.3010348312366E+19) +--- testing: 9 * -9223372034707292160 --- +float(-8.3010348312366E+19) +--- testing: 9 * 2147483648 --- +int(19327352832) +--- testing: 9 * -2147483649 --- +int(-19327352841) +--- testing: 9 * 4294967294 --- +int(38654705646) +--- testing: 9 * 4294967295 --- +int(38654705655) +--- testing: 9 * 4294967293 --- +int(38654705637) +--- testing: 9 * 9223372036854775806 --- +float(8.3010348331693E+19) +--- testing: 9 * 9.2233720368548E+18 --- +float(8.3010348331693E+19) +--- testing: 9 * -9223372036854775807 --- +float(-8.3010348331693E+19) +--- testing: 9 * -9.2233720368548E+18 --- +float(-8.3010348331693E+19) +--- testing: 65 * 9223372036854775807 --- +float(5.9951918239556E+20) +--- testing: 65 * -9223372036854775808 --- +float(-5.9951918239556E+20) +--- testing: 65 * 2147483647 --- +int(139586437055) +--- testing: 65 * -2147483648 --- +int(-139586437120) +--- testing: 65 * 9223372034707292160 --- +float(5.9951918225597E+20) +--- testing: 65 * -9223372034707292160 --- +float(-5.9951918225597E+20) +--- testing: 65 * 2147483648 --- +int(139586437120) +--- testing: 65 * -2147483649 --- +int(-139586437185) +--- testing: 65 * 4294967294 --- +int(279172874110) +--- testing: 65 * 4294967295 --- +int(279172874175) +--- testing: 65 * 4294967293 --- +int(279172874045) +--- testing: 65 * 9223372036854775806 --- +float(5.9951918239556E+20) +--- testing: 65 * 9.2233720368548E+18 --- +float(5.9951918239556E+20) +--- testing: 65 * -9223372036854775807 --- +float(-5.9951918239556E+20) +--- testing: 65 * -9.2233720368548E+18 --- +float(-5.9951918239556E+20) +--- testing: -44 * 9223372036854775807 --- +float(-4.0582836962161E+20) +--- testing: -44 * -9223372036854775808 --- +float(4.0582836962161E+20) +--- testing: -44 * 2147483647 --- +int(-94489280468) +--- testing: -44 * -2147483648 --- +int(94489280512) +--- testing: -44 * 9223372034707292160 --- +float(-4.0582836952712E+20) +--- testing: -44 * -9223372034707292160 --- +float(4.0582836952712E+20) +--- testing: -44 * 2147483648 --- +int(-94489280512) +--- testing: -44 * -2147483649 --- +int(94489280556) +--- testing: -44 * 4294967294 --- +int(-188978560936) +--- testing: -44 * 4294967295 --- +int(-188978560980) +--- testing: -44 * 4294967293 --- +int(-188978560892) +--- testing: -44 * 9223372036854775806 --- +float(-4.0582836962161E+20) +--- testing: -44 * 9.2233720368548E+18 --- +float(-4.0582836962161E+20) +--- testing: -44 * -9223372036854775807 --- +float(4.0582836962161E+20) +--- testing: -44 * -9.2233720368548E+18 --- +float(4.0582836962161E+20) +--- testing: 2147483647 * 9223372036854775807 --- +float(1.9807040619343E+28) +--- testing: 2147483647 * -9223372036854775808 --- +float(-1.9807040619343E+28) +--- testing: 2147483647 * 2147483647 --- +int(4611686014132420609) +--- testing: 2147483647 * -2147483648 --- +int(-4611686016279904256) +--- testing: 2147483647 * 9223372034707292160 --- +float(1.9807040614731E+28) +--- testing: 2147483647 * -9223372034707292160 --- +float(-1.9807040614731E+28) +--- testing: 2147483647 * 2147483648 --- +int(4611686016279904256) +--- testing: 2147483647 * -2147483649 --- +int(-4611686018427387903) +--- testing: 2147483647 * 4294967294 --- +int(9223372028264841218) +--- testing: 2147483647 * 4294967295 --- +int(9223372030412324865) +--- testing: 2147483647 * 4294967293 --- +int(9223372026117357571) +--- testing: 2147483647 * 9223372036854775806 --- +float(1.9807040619343E+28) +--- testing: 2147483647 * 9.2233720368548E+18 --- +float(1.9807040619343E+28) +--- testing: 2147483647 * -9223372036854775807 --- +float(-1.9807040619343E+28) +--- testing: 2147483647 * -9.2233720368548E+18 --- +float(-1.9807040619343E+28) +--- testing: 9223372036854775807 * 9223372036854775807 --- +float(8.5070591730235E+37) +--- testing: 9223372036854775807 * -9223372036854775808 --- +float(-8.5070591730235E+37) +--- testing: 9223372036854775807 * 2147483647 --- +float(1.9807040619343E+28) +--- testing: 9223372036854775807 * -2147483648 --- +float(-1.9807040628566E+28) +--- testing: 9223372036854775807 * 9223372034707292160 --- +float(8.5070591710428E+37) +--- testing: 9223372036854775807 * -9223372034707292160 --- +float(-8.5070591710428E+37) +--- testing: 9223372036854775807 * 2147483648 --- +float(1.9807040628566E+28) +--- testing: 9223372036854775807 * -2147483649 --- +float(-1.9807040637789E+28) +--- testing: 9223372036854775807 * 4294967294 --- +float(3.9614081238685E+28) +--- testing: 9223372036854775807 * 4294967295 --- +float(3.9614081247909E+28) +--- testing: 9223372036854775807 * 4294967293 --- +float(3.9614081229462E+28) +--- testing: 9223372036854775807 * 9223372036854775806 --- +float(8.5070591730235E+37) +--- testing: 9223372036854775807 * 9.2233720368548E+18 --- +float(8.5070591730235E+37) +--- testing: 9223372036854775807 * -9223372036854775807 --- +float(-8.5070591730235E+37) +--- testing: 9223372036854775807 * -9.2233720368548E+18 --- +float(-8.5070591730235E+37) +===DONE=== diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt new file mode 100644 index 0000000..30d5f79 --- /dev/null +++ b/tests/lang/operators/multiply_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test * operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' * '0' --- +int(0) +--- testing: '0' * '65' --- +int(0) +--- testing: '0' * '-44' --- +int(0) +--- testing: '0' * '1.2' --- +float(0) +--- testing: '0' * '-7.7' --- +float(-0) +--- testing: '0' * 'abc' --- +int(0) +--- testing: '0' * '123abc' --- +int(0) +--- testing: '0' * '123e5' --- +float(0) +--- testing: '0' * '123e5xyz' --- +float(0) +--- testing: '0' * ' 123abc' --- +int(0) +--- testing: '0' * '123 abc' --- +int(0) +--- testing: '0' * '123abc ' --- +int(0) +--- testing: '0' * '3.4a' --- +float(0) +--- testing: '0' * 'a5.9' --- +int(0) +--- testing: '65' * '0' --- +int(0) +--- testing: '65' * '65' --- +int(4225) +--- testing: '65' * '-44' --- +int(-2860) +--- testing: '65' * '1.2' --- +float(78) +--- testing: '65' * '-7.7' --- +float(-500.5) +--- testing: '65' * 'abc' --- +int(0) +--- testing: '65' * '123abc' --- +int(7995) +--- testing: '65' * '123e5' --- +float(799500000) +--- testing: '65' * '123e5xyz' --- +float(799500000) +--- testing: '65' * ' 123abc' --- +int(7995) +--- testing: '65' * '123 abc' --- +int(7995) +--- testing: '65' * '123abc ' --- +int(7995) +--- testing: '65' * '3.4a' --- +float(221) +--- testing: '65' * 'a5.9' --- +int(0) +--- testing: '-44' * '0' --- +int(0) +--- testing: '-44' * '65' --- +int(-2860) +--- testing: '-44' * '-44' --- +int(1936) +--- testing: '-44' * '1.2' --- +float(-52.8) +--- testing: '-44' * '-7.7' --- +float(338.8) +--- testing: '-44' * 'abc' --- +int(0) +--- testing: '-44' * '123abc' --- +int(-5412) +--- testing: '-44' * '123e5' --- +float(-541200000) +--- testing: '-44' * '123e5xyz' --- +float(-541200000) +--- testing: '-44' * ' 123abc' --- +int(-5412) +--- testing: '-44' * '123 abc' --- +int(-5412) +--- testing: '-44' * '123abc ' --- +int(-5412) +--- testing: '-44' * '3.4a' --- +float(-149.6) +--- testing: '-44' * 'a5.9' --- +int(0) +--- testing: '1.2' * '0' --- +float(0) +--- testing: '1.2' * '65' --- +float(78) +--- testing: '1.2' * '-44' --- +float(-52.8) +--- testing: '1.2' * '1.2' --- +float(1.44) +--- testing: '1.2' * '-7.7' --- +float(-9.24) +--- testing: '1.2' * 'abc' --- +float(0) +--- testing: '1.2' * '123abc' --- +float(147.6) +--- testing: '1.2' * '123e5' --- +float(14760000) +--- testing: '1.2' * '123e5xyz' --- +float(14760000) +--- testing: '1.2' * ' 123abc' --- +float(147.6) +--- testing: '1.2' * '123 abc' --- +float(147.6) +--- testing: '1.2' * '123abc ' --- +float(147.6) +--- testing: '1.2' * '3.4a' --- +float(4.08) +--- testing: '1.2' * 'a5.9' --- +float(0) +--- testing: '-7.7' * '0' --- +float(-0) +--- testing: '-7.7' * '65' --- +float(-500.5) +--- testing: '-7.7' * '-44' --- +float(338.8) +--- testing: '-7.7' * '1.2' --- +float(-9.24) +--- testing: '-7.7' * '-7.7' --- +float(59.29) +--- testing: '-7.7' * 'abc' --- +float(-0) +--- testing: '-7.7' * '123abc' --- +float(-947.1) +--- testing: '-7.7' * '123e5' --- +float(-94710000) +--- testing: '-7.7' * '123e5xyz' --- +float(-94710000) +--- testing: '-7.7' * ' 123abc' --- +float(-947.1) +--- testing: '-7.7' * '123 abc' --- +float(-947.1) +--- testing: '-7.7' * '123abc ' --- +float(-947.1) +--- testing: '-7.7' * '3.4a' --- +float(-26.18) +--- testing: '-7.7' * 'a5.9' --- +float(-0) +--- testing: 'abc' * '0' --- +int(0) +--- testing: 'abc' * '65' --- +int(0) +--- testing: 'abc' * '-44' --- +int(0) +--- testing: 'abc' * '1.2' --- +float(0) +--- testing: 'abc' * '-7.7' --- +float(-0) +--- testing: 'abc' * 'abc' --- +int(0) +--- testing: 'abc' * '123abc' --- +int(0) +--- testing: 'abc' * '123e5' --- +float(0) +--- testing: 'abc' * '123e5xyz' --- +float(0) +--- testing: 'abc' * ' 123abc' --- +int(0) +--- testing: 'abc' * '123 abc' --- +int(0) +--- testing: 'abc' * '123abc ' --- +int(0) +--- testing: 'abc' * '3.4a' --- +float(0) +--- testing: 'abc' * 'a5.9' --- +int(0) +--- testing: '123abc' * '0' --- +int(0) +--- testing: '123abc' * '65' --- +int(7995) +--- testing: '123abc' * '-44' --- +int(-5412) +--- testing: '123abc' * '1.2' --- +float(147.6) +--- testing: '123abc' * '-7.7' --- +float(-947.1) +--- testing: '123abc' * 'abc' --- +int(0) +--- testing: '123abc' * '123abc' --- +int(15129) +--- testing: '123abc' * '123e5' --- +float(1512900000) +--- testing: '123abc' * '123e5xyz' --- +float(1512900000) +--- testing: '123abc' * ' 123abc' --- +int(15129) +--- testing: '123abc' * '123 abc' --- +int(15129) +--- testing: '123abc' * '123abc ' --- +int(15129) +--- testing: '123abc' * '3.4a' --- +float(418.2) +--- testing: '123abc' * 'a5.9' --- +int(0) +--- testing: '123e5' * '0' --- +float(0) +--- testing: '123e5' * '65' --- +float(799500000) +--- testing: '123e5' * '-44' --- +float(-541200000) +--- testing: '123e5' * '1.2' --- +float(14760000) +--- testing: '123e5' * '-7.7' --- +float(-94710000) +--- testing: '123e5' * 'abc' --- +float(0) +--- testing: '123e5' * '123abc' --- +float(1512900000) +--- testing: '123e5' * '123e5' --- +float(1.5129E+14) +--- testing: '123e5' * '123e5xyz' --- +float(1.5129E+14) +--- testing: '123e5' * ' 123abc' --- +float(1512900000) +--- testing: '123e5' * '123 abc' --- +float(1512900000) +--- testing: '123e5' * '123abc ' --- +float(1512900000) +--- testing: '123e5' * '3.4a' --- +float(41820000) +--- testing: '123e5' * 'a5.9' --- +float(0) +--- testing: '123e5xyz' * '0' --- +float(0) +--- testing: '123e5xyz' * '65' --- +float(799500000) +--- testing: '123e5xyz' * '-44' --- +float(-541200000) +--- testing: '123e5xyz' * '1.2' --- +float(14760000) +--- testing: '123e5xyz' * '-7.7' --- +float(-94710000) +--- testing: '123e5xyz' * 'abc' --- +float(0) +--- testing: '123e5xyz' * '123abc' --- +float(1512900000) +--- testing: '123e5xyz' * '123e5' --- +float(1.5129E+14) +--- testing: '123e5xyz' * '123e5xyz' --- +float(1.5129E+14) +--- testing: '123e5xyz' * ' 123abc' --- +float(1512900000) +--- testing: '123e5xyz' * '123 abc' --- +float(1512900000) +--- testing: '123e5xyz' * '123abc ' --- +float(1512900000) +--- testing: '123e5xyz' * '3.4a' --- +float(41820000) +--- testing: '123e5xyz' * 'a5.9' --- +float(0) +--- testing: ' 123abc' * '0' --- +int(0) +--- testing: ' 123abc' * '65' --- +int(7995) +--- testing: ' 123abc' * '-44' --- +int(-5412) +--- testing: ' 123abc' * '1.2' --- +float(147.6) +--- testing: ' 123abc' * '-7.7' --- +float(-947.1) +--- testing: ' 123abc' * 'abc' --- +int(0) +--- testing: ' 123abc' * '123abc' --- +int(15129) +--- testing: ' 123abc' * '123e5' --- +float(1512900000) +--- testing: ' 123abc' * '123e5xyz' --- +float(1512900000) +--- testing: ' 123abc' * ' 123abc' --- +int(15129) +--- testing: ' 123abc' * '123 abc' --- +int(15129) +--- testing: ' 123abc' * '123abc ' --- +int(15129) +--- testing: ' 123abc' * '3.4a' --- +float(418.2) +--- testing: ' 123abc' * 'a5.9' --- +int(0) +--- testing: '123 abc' * '0' --- +int(0) +--- testing: '123 abc' * '65' --- +int(7995) +--- testing: '123 abc' * '-44' --- +int(-5412) +--- testing: '123 abc' * '1.2' --- +float(147.6) +--- testing: '123 abc' * '-7.7' --- +float(-947.1) +--- testing: '123 abc' * 'abc' --- +int(0) +--- testing: '123 abc' * '123abc' --- +int(15129) +--- testing: '123 abc' * '123e5' --- +float(1512900000) +--- testing: '123 abc' * '123e5xyz' --- +float(1512900000) +--- testing: '123 abc' * ' 123abc' --- +int(15129) +--- testing: '123 abc' * '123 abc' --- +int(15129) +--- testing: '123 abc' * '123abc ' --- +int(15129) +--- testing: '123 abc' * '3.4a' --- +float(418.2) +--- testing: '123 abc' * 'a5.9' --- +int(0) +--- testing: '123abc ' * '0' --- +int(0) +--- testing: '123abc ' * '65' --- +int(7995) +--- testing: '123abc ' * '-44' --- +int(-5412) +--- testing: '123abc ' * '1.2' --- +float(147.6) +--- testing: '123abc ' * '-7.7' --- +float(-947.1) +--- testing: '123abc ' * 'abc' --- +int(0) +--- testing: '123abc ' * '123abc' --- +int(15129) +--- testing: '123abc ' * '123e5' --- +float(1512900000) +--- testing: '123abc ' * '123e5xyz' --- +float(1512900000) +--- testing: '123abc ' * ' 123abc' --- +int(15129) +--- testing: '123abc ' * '123 abc' --- +int(15129) +--- testing: '123abc ' * '123abc ' --- +int(15129) +--- testing: '123abc ' * '3.4a' --- +float(418.2) +--- testing: '123abc ' * 'a5.9' --- +int(0) +--- testing: '3.4a' * '0' --- +float(0) +--- testing: '3.4a' * '65' --- +float(221) +--- testing: '3.4a' * '-44' --- +float(-149.6) +--- testing: '3.4a' * '1.2' --- +float(4.08) +--- testing: '3.4a' * '-7.7' --- +float(-26.18) +--- testing: '3.4a' * 'abc' --- +float(0) +--- testing: '3.4a' * '123abc' --- +float(418.2) +--- testing: '3.4a' * '123e5' --- +float(41820000) +--- testing: '3.4a' * '123e5xyz' --- +float(41820000) +--- testing: '3.4a' * ' 123abc' --- +float(418.2) +--- testing: '3.4a' * '123 abc' --- +float(418.2) +--- testing: '3.4a' * '123abc ' --- +float(418.2) +--- testing: '3.4a' * '3.4a' --- +float(11.56) +--- testing: '3.4a' * 'a5.9' --- +float(0) +--- testing: 'a5.9' * '0' --- +int(0) +--- testing: 'a5.9' * '65' --- +int(0) +--- testing: 'a5.9' * '-44' --- +int(0) +--- testing: 'a5.9' * '1.2' --- +float(0) +--- testing: 'a5.9' * '-7.7' --- +float(-0) +--- testing: 'a5.9' * 'abc' --- +int(0) +--- testing: 'a5.9' * '123abc' --- +int(0) +--- testing: 'a5.9' * '123e5' --- +float(0) +--- testing: 'a5.9' * '123e5xyz' --- +float(0) +--- testing: 'a5.9' * ' 123abc' --- +int(0) +--- testing: 'a5.9' * '123 abc' --- +int(0) +--- testing: 'a5.9' * '123abc ' --- +int(0) +--- testing: 'a5.9' * '3.4a' --- +float(0) +--- testing: 'a5.9' * 'a5.9' --- +int(0) +===DONE=== diff --git a/tests/lang/operators/negate_basiclong_64bit.phpt b/tests/lang/operators/negate_basiclong_64bit.phpt new file mode 100644 index 0000000..e0cf10d --- /dev/null +++ b/tests/lang/operators/negate_basiclong_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test -N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +int(-9223372036854775807) +--- testing: -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 2147483647 --- +int(-2147483647) +--- testing: -2147483648 --- +int(2147483648) +--- testing: 9223372034707292160 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 --- +int(9223372034707292160) +--- testing: 2147483648 --- +int(-2147483648) +--- testing: -2147483649 --- +int(2147483649) +--- testing: 4294967294 --- +int(-4294967294) +--- testing: 4294967295 --- +int(-4294967295) +--- testing: 4294967293 --- +int(-4294967293) +--- testing: 9223372036854775806 --- +int(-9223372036854775806) +--- testing: 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(9223372036854775807) +--- testing: -9.2233720368548E+18 --- +float(9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt new file mode 100644 index 0000000..a25bdda --- /dev/null +++ b/tests/lang/operators/negate_variationStr.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test -N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(0) +--- testing: '65' --- +int(-65) +--- testing: '-44' --- +int(44) +--- testing: '1.2' --- +float(-1.2) +--- testing: '-7.7' --- +float(7.7) +--- testing: 'abc' --- +int(0) +--- testing: '123abc' --- +int(-123) +--- testing: '123e5' --- +float(-12300000) +--- testing: '123e5xyz' --- +float(-12300000) +--- testing: ' 123abc' --- +int(-123) +--- testing: '123 abc' --- +int(-123) +--- testing: '123abc ' --- +int(-123) +--- testing: '3.4a' --- +float(-3.4) +--- testing: 'a5.9' --- +int(0) +===DONE=== diff --git a/tests/lang/operators/operator_equals_basic.phpt b/tests/lang/operators/operator_equals_basic.phpt new file mode 100644 index 0000000..1b42fc3 --- /dev/null +++ b/tests/lang/operators/operator_equals_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test == operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_equals_variation.phpt b/tests/lang/operators/operator_equals_variation.phpt new file mode 100644 index 0000000..60e6abb --- /dev/null +++ b/tests/lang/operators/operator_equals_variation.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test == operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_equals_variation_64bit.phpt b/tests/lang/operators/operator_equals_variation_64bit.phpt new file mode 100644 index 0000000..b521735 --- /dev/null +++ b/tests/lang/operators/operator_equals_variation_64bit.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_basic.phpt b/tests/lang/operators/operator_gt_basic.phpt new file mode 100644 index 0000000..06fbcee --- /dev/null +++ b/tests/lang/operators/operator_gt_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test > operator : different types +--FILE-- + true for example +// also note that a string of "0" is converted to false but a string of "0.0" is converted to true +// false cannot be tested as 0 can never be > 0 or 1 + true, $valid_false, $valid_true, + $int1, $valid_int1, $invalid_int1, + $int2, $valid_int2, $invalid_int2, + $float1, $valid_float1, $invalid_float1, + $float2, $valid_float2, $invalid_float2 +); + +$failed = false; +for ($i = 0; $i < count($toCompare); $i +=3) { + $typeToTest = $toCompare[$i]; + $valid_compares = $toCompare[$i + 1]; + $invalid_compares = $toCompare[$i + 2]; + + foreach($valid_compares as $compareVal) { + if ($typeToTest > $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' <= '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest > $compareVal) { + echo "FAILED: '$typeToTest' > '$compareVal'\n"; + $failed = true; + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_or_equal_basic.phpt b/tests/lang/operators/operator_gt_or_equal_basic.phpt new file mode 100644 index 0000000..02a561c --- /dev/null +++ b/tests/lang/operators/operator_gt_or_equal_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test >= operator : different types +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' < '$compareVal'\n"; + $failed = true; + } + } + + if ($invalid_compares != NULL) { + foreach($invalid_compares as $compareVal) { + if ($typeToTest >= $compareVal) { + echo "FAILED: '$typeToTest' >= '$compareVal'\n"; + $failed = true; + } + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_or_equal_variation.phpt b/tests/lang/operators/operator_gt_or_equal_variation.phpt new file mode 100644 index 0000000..c4253b5 --- /dev/null +++ b/tests/lang/operators/operator_gt_or_equal_variation.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test >= operator : max int 32bit range +--SKIPIF-- + +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { + $typeToTestVal = $invalidGtOrEqual[$i]; + $compares = $invalidGtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal >= $compareVal) { + echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt new file mode 100644 index 0000000..a2f7aa4 --- /dev/null +++ b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test >= operator : max int 64bit range +--SKIPIF-- + +--FILE-- += $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) { + $typeToTestVal = $invalidGtOrEqual[$i]; + $compares = $invalidGtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal >= $compareVal) { + echo "FAILED: '$typeToTestVal' >= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_variation.phpt b/tests/lang/operators/operator_gt_variation.phpt new file mode 100644 index 0000000..a158824 --- /dev/null +++ b/tests/lang/operators/operator_gt_variation.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test > operator : max int 32bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { + $typeToTestVal = $invalidGreaterThan[$i]; + $compares = $invalidGreaterThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal > $compareVal) { + echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_gt_variation_64bit.phpt b/tests/lang/operators/operator_gt_variation_64bit.phpt new file mode 100644 index 0000000..6223e07 --- /dev/null +++ b/tests/lang/operators/operator_gt_variation_64bit.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test > operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidGreaterThan); $i +=2) { + $typeToTestVal = $invalidGreaterThan[$i]; + $compares = $invalidGreaterThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal > $compareVal) { + echo "FAILED: '$typeToTestVal' > '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_identical_basic.phpt b/tests/lang/operators/operator_identical_basic.phpt new file mode 100644 index 0000000..a4cd8a0 --- /dev/null +++ b/tests/lang/operators/operator_identical_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test === operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_identical_variation.phpt b/tests/lang/operators/operator_identical_variation.phpt new file mode 100644 index 0000000..76639c7 --- /dev/null +++ b/tests/lang/operators/operator_identical_variation.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test === operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_identical_variation_64bit.phpt b/tests/lang/operators/operator_identical_variation_64bit.phpt new file mode 100644 index 0000000..0909c44 --- /dev/null +++ b/tests/lang/operators/operator_identical_variation_64bit.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test === operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_basic.phpt b/tests/lang/operators/operator_lt_basic.phpt new file mode 100644 index 0000000..137adf2 --- /dev/null +++ b/tests/lang/operators/operator_lt_basic.phpt @@ -0,0 +1,62 @@ +--TEST-- +Test < operator : different types +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest < $compareVal) { + echo "FAILED: '$typeToTest' < '$compareVal'\n"; + $failed = true; + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_or_equal_basic.phpt b/tests/lang/operators/operator_lt_or_equal_basic.phpt new file mode 100644 index 0000000..381b813 --- /dev/null +++ b/tests/lang/operators/operator_lt_or_equal_basic.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test <= operator : different types +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } + + if ($invalid_compares != NULL) { + foreach($invalid_compares as $compareVal) { + if ($typeToTest <= $compareVal) { + echo "FAILED: '$typeToTest' <= '$compareVal'\n"; + $failed = true; + } + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_or_equal_variation.phpt b/tests/lang/operators/operator_lt_or_equal_variation.phpt new file mode 100644 index 0000000..8f5f945 --- /dev/null +++ b/tests/lang/operators/operator_lt_or_equal_variation.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test <= operator : max int 32bit range +--SKIPIF-- + +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { + $typeToTestVal = $invalidLtOrEqual[$i]; + $compares = $invalidLtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal <= $compareVal) { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt new file mode 100644 index 0000000..03c974f --- /dev/null +++ b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test <= operator : max int 64bit range +--SKIPIF-- + +--FILE-- + '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) { + $typeToTestVal = $invalidLtOrEqual[$i]; + $compares = $invalidLtOrEqual[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal <= $compareVal) { + echo "FAILED: '$typeToTestVal' <= '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_variation.phpt b/tests/lang/operators/operator_lt_variation.phpt new file mode 100644 index 0000000..a2a8f6a --- /dev/null +++ b/tests/lang/operators/operator_lt_variation.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test < operator : max int 32bit range +--SKIPIF-- + +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidLessThan); $i +=2) { + $typeToTestVal = $invalidLessThan[$i]; + $compares = $invalidLessThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal < $compareVal) { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_lt_variation_64bit.phpt b/tests/lang/operators/operator_lt_variation_64bit.phpt new file mode 100644 index 0000000..172ef39 --- /dev/null +++ b/tests/lang/operators/operator_lt_variation_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test < operator : max int 64bit range +--SKIPIF-- + +--FILE-- += '$compareVal'\n"; + $failed = true; + } + } +} +// test for invalid values +for ($i = 0; $i < count($invalidLessThan); $i +=2) { + $typeToTestVal = $invalidLessThan[$i]; + $compares = $invalidLessThan[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal < $compareVal) { + echo "FAILED: '$typeToTestVal' < '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notequals_basic.phpt b/tests/lang/operators/operator_notequals_basic.phpt new file mode 100644 index 0000000..059c99d --- /dev/null +++ b/tests/lang/operators/operator_notequals_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test != operator : different types +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTest' == '$compareVal'\n"; + $failed = true; + } + } + + foreach($invalid_compares as $compareVal) { + if ($typeToTest != $compareVal || $typeToTest <> $compareVal) { + echo "FAILED: '$typeToTest' != '$compareVal'\n"; + $failed = true; + } + } + +} +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notequals_variation.phpt b/tests/lang/operators/operator_notequals_variation.phpt new file mode 100644 index 0000000..a7827b4 --- /dev/null +++ b/tests/lang/operators/operator_notequals_variation.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test != operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notequals_variation_64bit.phpt b/tests/lang/operators/operator_notequals_variation_64bit.phpt new file mode 100644 index 0000000..ed26b52 --- /dev/null +++ b/tests/lang/operators/operator_notequals_variation_64bit.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test == operator : max int 64bit range +--SKIPIF-- + +--FILE-- + $compareVal) { + // do nothing + } + else { + echo "FAILED: '$typeToTestVal' == '$compareVal'\n"; + $failed = true; + } + } +} +// test invalid values +for ($i = 0; $i < count($invalidNotEquals); $i +=2) { + $typeToTestVal = $invalidNotEquals[$i]; + $compares = $invalidNotEquals[$i + 1]; + foreach($compares as $compareVal) { + if ($typeToTestVal != $compareVal || $typeToTestVal <> $compareVal) { + echo "FAILED: '$typeToTestVal' != '$compareVal'\n"; + $failed = true; + } + } +} + +if ($failed == false) { + echo "Test Passed\n"; +} + +?> +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notidentical_basic.phpt b/tests/lang/operators/operator_notidentical_basic.phpt new file mode 100644 index 0000000..d433289 --- /dev/null +++ b/tests/lang/operators/operator_notidentical_basic.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test !== operator : different types +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notidentical_variation.phpt b/tests/lang/operators/operator_notidentical_variation.phpt new file mode 100644 index 0000000..9af6f8d --- /dev/null +++ b/tests/lang/operators/operator_notidentical_variation.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test !== operator : max int 32bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/operator_notidentical_variation_64bit.phpt b/tests/lang/operators/operator_notidentical_variation_64bit.phpt new file mode 100644 index 0000000..e8f2c7e --- /dev/null +++ b/tests/lang/operators/operator_notidentical_variation_64bit.phpt @@ -0,0 +1,65 @@ +--TEST-- +Test !== operator : max int 64bit range +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Test Passed +===DONE=== \ No newline at end of file diff --git a/tests/lang/operators/postdec_basiclong_64bit.phpt b/tests/lang/operators/postdec_basiclong_64bit.phpt new file mode 100644 index 0000000..9875df8 --- /dev/null +++ b/tests/lang/operators/postdec_basiclong_64bit.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test N-- operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +int(9223372036854775806) +--- testing: -9223372036854775808 --- +float(-9.2233720368548E+18) +--- testing: 2147483647 --- +int(2147483646) +--- testing: -2147483648 --- +int(-2147483649) +--- testing: 9223372034707292160 --- +int(9223372034707292159) +--- testing: -9223372034707292160 --- +int(-9223372034707292161) +--- testing: 2147483648 --- +int(2147483647) +--- testing: -2147483649 --- +int(-2147483650) +--- testing: 4294967294 --- +int(4294967293) +--- testing: 4294967295 --- +int(4294967294) +--- testing: 4294967293 --- +int(4294967292) +--- testing: 9223372036854775806 --- +int(9223372036854775805) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/postdec_variationStr.phpt b/tests/lang/operators/postdec_variationStr.phpt new file mode 100644 index 0000000..ee5a8cd --- /dev/null +++ b/tests/lang/operators/postdec_variationStr.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test N-- operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(-1) +--- testing: '65' --- +int(64) +--- testing: '-44' --- +int(-45) +--- testing: '1.2' --- +float(0.2) +--- testing: '-7.7' --- +float(-8.7) +--- testing: 'abc' --- +string(3) "abc" +--- testing: '123abc' --- +string(6) "123abc" +--- testing: '123e5' --- +float(12299999) +--- testing: '123e5xyz' --- +string(8) "123e5xyz" +--- testing: ' 123abc' --- +string(7) " 123abc" +--- testing: '123 abc' --- +string(7) "123 abc" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +string(4) "3.4a" +--- testing: 'a5.9' --- +string(4) "a5.9" +===DONE=== diff --git a/tests/lang/operators/postinc_basiclong_64bit.phpt b/tests/lang/operators/postinc_basiclong_64bit.phpt new file mode 100644 index 0000000..494259a --- /dev/null +++ b/tests/lang/operators/postinc_basiclong_64bit.phpt @@ -0,0 +1,61 @@ +--TEST-- +Test N++ operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 2147483647 --- +int(2147483648) +--- testing: -2147483648 --- +int(-2147483647) +--- testing: 9223372034707292160 --- +int(9223372034707292161) +--- testing: -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 2147483648 --- +int(2147483649) +--- testing: -2147483649 --- +int(-2147483648) +--- testing: 4294967294 --- +int(4294967295) +--- testing: 4294967295 --- +int(4294967296) +--- testing: 4294967293 --- +int(4294967294) +--- testing: 9223372036854775806 --- +int(9223372036854775807) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775806) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/postinc_variationStr.phpt b/tests/lang/operators/postinc_variationStr.phpt new file mode 100644 index 0000000..6fbe804 --- /dev/null +++ b/tests/lang/operators/postinc_variationStr.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test N++ operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(1) +--- testing: '65' --- +int(66) +--- testing: '-44' --- +int(-43) +--- testing: '1.2' --- +float(2.2) +--- testing: '-7.7' --- +float(-6.7) +--- testing: 'abc' --- +string(3) "abd" +--- testing: '123abc' --- +string(6) "123abd" +--- testing: '123e5' --- +float(12300001) +--- testing: '123e5xyz' --- +string(8) "123e5xza" +--- testing: ' 123abc' --- +string(7) " 123abd" +--- testing: '123 abc' --- +string(7) "123 abd" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +string(4) "3.4b" +--- testing: 'a5.9' --- +string(4) "a5.0" +===DONE=== diff --git a/tests/lang/operators/predec_basiclong_64bit.phpt b/tests/lang/operators/predec_basiclong_64bit.phpt new file mode 100644 index 0000000..c1b15fd --- /dev/null +++ b/tests/lang/operators/predec_basiclong_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test --N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +int(9223372036854775806) +--- testing: -9223372036854775808 --- +float(-9.2233720368548E+18) +--- testing: 2147483647 --- +int(2147483646) +--- testing: -2147483648 --- +int(-2147483649) +--- testing: 9223372034707292160 --- +int(9223372034707292159) +--- testing: -9223372034707292160 --- +int(-9223372034707292161) +--- testing: 2147483648 --- +int(2147483647) +--- testing: -2147483649 --- +int(-2147483650) +--- testing: 4294967294 --- +int(4294967293) +--- testing: 4294967295 --- +int(4294967294) +--- testing: 4294967293 --- +int(4294967292) +--- testing: 9223372036854775806 --- +int(9223372036854775805) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775808) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/predec_variationStr.phpt b/tests/lang/operators/predec_variationStr.phpt new file mode 100644 index 0000000..c7fb574 --- /dev/null +++ b/tests/lang/operators/predec_variationStr.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test --N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(-1) +--- testing: '65' --- +int(64) +--- testing: '-44' --- +int(-45) +--- testing: '1.2' --- +float(0.2) +--- testing: '-7.7' --- +float(-8.7) +--- testing: 'abc' --- +string(3) "abc" +--- testing: '123abc' --- +string(6) "123abc" +--- testing: '123e5' --- +float(12299999) +--- testing: '123e5xyz' --- +string(8) "123e5xyz" +--- testing: ' 123abc' --- +string(7) " 123abc" +--- testing: '123 abc' --- +string(7) "123 abc" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +string(4) "3.4a" +--- testing: 'a5.9' --- +string(4) "a5.9" +===DONE=== diff --git a/tests/lang/operators/preinc_basiclong_64bit.phpt b/tests/lang/operators/preinc_basiclong_64bit.phpt new file mode 100644 index 0000000..599aa4e --- /dev/null +++ b/tests/lang/operators/preinc_basiclong_64bit.phpt @@ -0,0 +1,60 @@ +--TEST-- +Test ++N operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775808 --- +int(-9223372036854775807) +--- testing: 2147483647 --- +int(2147483648) +--- testing: -2147483648 --- +int(-2147483647) +--- testing: 9223372034707292160 --- +int(9223372034707292161) +--- testing: -9223372034707292160 --- +int(-9223372034707292159) +--- testing: 2147483648 --- +int(2147483649) +--- testing: -2147483649 --- +int(-2147483648) +--- testing: 4294967294 --- +int(4294967295) +--- testing: 4294967295 --- +int(4294967296) +--- testing: 4294967293 --- +int(4294967294) +--- testing: 9223372036854775806 --- +int(9223372036854775807) +--- testing: 9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -9223372036854775807 --- +int(-9223372036854775806) +--- testing: -9.2233720368548E+18 --- +float(-9.2233720368548E+18) +===DONE=== diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt new file mode 100644 index 0000000..010a237 --- /dev/null +++ b/tests/lang/operators/preinc_variationStr.phpt @@ -0,0 +1,48 @@ +--TEST-- +Test ++N operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' --- +int(1) +--- testing: '65' --- +int(66) +--- testing: '-44' --- +int(-43) +--- testing: '1.2' --- +float(2.2) +--- testing: '-7.7' --- +float(-6.7) +--- testing: 'abc' --- +string(3) "abd" +--- testing: '123abc' --- +string(6) "123abd" +--- testing: '123e5' --- +float(12300001) +--- testing: '123e5xyz' --- +string(8) "123e5xza" +--- testing: ' 123abc' --- +string(7) " 123abd" +--- testing: '123 abc' --- +string(7) "123 abd" +--- testing: '123abc ' --- +string(7) "123abc " +--- testing: '3.4a' --- +string(4) "3.4b" +--- testing: 'a5.9' --- +string(4) "a5.0" +===DONE=== diff --git a/tests/lang/operators/subtract_basiclong_64bit.phpt b/tests/lang/operators/subtract_basiclong_64bit.phpt new file mode 100644 index 0000000..f52b951 --- /dev/null +++ b/tests/lang/operators/subtract_basiclong_64bit.phpt @@ -0,0 +1,582 @@ +--TEST-- +Test - operator : 64bit long tests +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: 9223372036854775807 - 0 --- +int(9223372036854775807) +--- testing: 9223372036854775807 - 1 --- +int(9223372036854775806) +--- testing: 9223372036854775807 - -1 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 - 7 --- +int(9223372036854775800) +--- testing: 9223372036854775807 - 9 --- +int(9223372036854775798) +--- testing: 9223372036854775807 - 65 --- +int(9223372036854775742) +--- testing: 9223372036854775807 - -44 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775807 - 2147483647 --- +int(9223372034707292160) +--- testing: 9223372036854775807 - 9223372036854775807 --- +int(0) +--- testing: -9223372036854775808 - 0 --- +int(-9223372036854775808) +--- testing: -9223372036854775808 - 1 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 - -1 --- +int(-9223372036854775807) +--- testing: -9223372036854775808 - 7 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 - 9 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 - 65 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775808 - -44 --- +int(-9223372036854775764) +--- testing: -9223372036854775808 - 2147483647 --- +float(-9.2233720390023E+18) +--- testing: -9223372036854775808 - 9223372036854775807 --- +float(-1.844674407371E+19) +--- testing: 2147483647 - 0 --- +int(2147483647) +--- testing: 2147483647 - 1 --- +int(2147483646) +--- testing: 2147483647 - -1 --- +int(2147483648) +--- testing: 2147483647 - 7 --- +int(2147483640) +--- testing: 2147483647 - 9 --- +int(2147483638) +--- testing: 2147483647 - 65 --- +int(2147483582) +--- testing: 2147483647 - -44 --- +int(2147483691) +--- testing: 2147483647 - 2147483647 --- +int(0) +--- testing: 2147483647 - 9223372036854775807 --- +int(-9223372034707292160) +--- testing: -2147483648 - 0 --- +int(-2147483648) +--- testing: -2147483648 - 1 --- +int(-2147483649) +--- testing: -2147483648 - -1 --- +int(-2147483647) +--- testing: -2147483648 - 7 --- +int(-2147483655) +--- testing: -2147483648 - 9 --- +int(-2147483657) +--- testing: -2147483648 - 65 --- +int(-2147483713) +--- testing: -2147483648 - -44 --- +int(-2147483604) +--- testing: -2147483648 - 2147483647 --- +int(-4294967295) +--- testing: -2147483648 - 9223372036854775807 --- +float(-9.2233720390023E+18) +--- testing: 9223372034707292160 - 0 --- +int(9223372034707292160) +--- testing: 9223372034707292160 - 1 --- +int(9223372034707292159) +--- testing: 9223372034707292160 - -1 --- +int(9223372034707292161) +--- testing: 9223372034707292160 - 7 --- +int(9223372034707292153) +--- testing: 9223372034707292160 - 9 --- +int(9223372034707292151) +--- testing: 9223372034707292160 - 65 --- +int(9223372034707292095) +--- testing: 9223372034707292160 - -44 --- +int(9223372034707292204) +--- testing: 9223372034707292160 - 2147483647 --- +int(9223372032559808513) +--- testing: 9223372034707292160 - 9223372036854775807 --- +int(-2147483647) +--- testing: -9223372034707292160 - 0 --- +int(-9223372034707292160) +--- testing: -9223372034707292160 - 1 --- +int(-9223372034707292161) +--- testing: -9223372034707292160 - -1 --- +int(-9223372034707292159) +--- testing: -9223372034707292160 - 7 --- +int(-9223372034707292167) +--- testing: -9223372034707292160 - 9 --- +int(-9223372034707292169) +--- testing: -9223372034707292160 - 65 --- +int(-9223372034707292225) +--- testing: -9223372034707292160 - -44 --- +int(-9223372034707292116) +--- testing: -9223372034707292160 - 2147483647 --- +int(-9223372036854775807) +--- testing: -9223372034707292160 - 9223372036854775807 --- +float(-1.8446744071562E+19) +--- testing: 2147483648 - 0 --- +int(2147483648) +--- testing: 2147483648 - 1 --- +int(2147483647) +--- testing: 2147483648 - -1 --- +int(2147483649) +--- testing: 2147483648 - 7 --- +int(2147483641) +--- testing: 2147483648 - 9 --- +int(2147483639) +--- testing: 2147483648 - 65 --- +int(2147483583) +--- testing: 2147483648 - -44 --- +int(2147483692) +--- testing: 2147483648 - 2147483647 --- +int(1) +--- testing: 2147483648 - 9223372036854775807 --- +int(-9223372034707292159) +--- testing: -2147483649 - 0 --- +int(-2147483649) +--- testing: -2147483649 - 1 --- +int(-2147483650) +--- testing: -2147483649 - -1 --- +int(-2147483648) +--- testing: -2147483649 - 7 --- +int(-2147483656) +--- testing: -2147483649 - 9 --- +int(-2147483658) +--- testing: -2147483649 - 65 --- +int(-2147483714) +--- testing: -2147483649 - -44 --- +int(-2147483605) +--- testing: -2147483649 - 2147483647 --- +int(-4294967296) +--- testing: -2147483649 - 9223372036854775807 --- +float(-9.2233720390023E+18) +--- testing: 4294967294 - 0 --- +int(4294967294) +--- testing: 4294967294 - 1 --- +int(4294967293) +--- testing: 4294967294 - -1 --- +int(4294967295) +--- testing: 4294967294 - 7 --- +int(4294967287) +--- testing: 4294967294 - 9 --- +int(4294967285) +--- testing: 4294967294 - 65 --- +int(4294967229) +--- testing: 4294967294 - -44 --- +int(4294967338) +--- testing: 4294967294 - 2147483647 --- +int(2147483647) +--- testing: 4294967294 - 9223372036854775807 --- +int(-9223372032559808513) +--- testing: 4294967295 - 0 --- +int(4294967295) +--- testing: 4294967295 - 1 --- +int(4294967294) +--- testing: 4294967295 - -1 --- +int(4294967296) +--- testing: 4294967295 - 7 --- +int(4294967288) +--- testing: 4294967295 - 9 --- +int(4294967286) +--- testing: 4294967295 - 65 --- +int(4294967230) +--- testing: 4294967295 - -44 --- +int(4294967339) +--- testing: 4294967295 - 2147483647 --- +int(2147483648) +--- testing: 4294967295 - 9223372036854775807 --- +int(-9223372032559808512) +--- testing: 4294967293 - 0 --- +int(4294967293) +--- testing: 4294967293 - 1 --- +int(4294967292) +--- testing: 4294967293 - -1 --- +int(4294967294) +--- testing: 4294967293 - 7 --- +int(4294967286) +--- testing: 4294967293 - 9 --- +int(4294967284) +--- testing: 4294967293 - 65 --- +int(4294967228) +--- testing: 4294967293 - -44 --- +int(4294967337) +--- testing: 4294967293 - 2147483647 --- +int(2147483646) +--- testing: 4294967293 - 9223372036854775807 --- +int(-9223372032559808514) +--- testing: 9223372036854775806 - 0 --- +int(9223372036854775806) +--- testing: 9223372036854775806 - 1 --- +int(9223372036854775805) +--- testing: 9223372036854775806 - -1 --- +int(9223372036854775807) +--- testing: 9223372036854775806 - 7 --- +int(9223372036854775799) +--- testing: 9223372036854775806 - 9 --- +int(9223372036854775797) +--- testing: 9223372036854775806 - 65 --- +int(9223372036854775741) +--- testing: 9223372036854775806 - -44 --- +float(9.2233720368548E+18) +--- testing: 9223372036854775806 - 2147483647 --- +int(9223372034707292159) +--- testing: 9223372036854775806 - 9223372036854775807 --- +int(-1) +--- testing: 9.2233720368548E+18 - 0 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - 1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - -1 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - 7 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - 9 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - 65 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - -44 --- +float(9.2233720368548E+18) +--- testing: 9.2233720368548E+18 - 2147483647 --- +float(9.2233720347073E+18) +--- testing: 9.2233720368548E+18 - 9223372036854775807 --- +float(0) +--- testing: -9223372036854775807 - 0 --- +int(-9223372036854775807) +--- testing: -9223372036854775807 - 1 --- +int(-9223372036854775808) +--- testing: -9223372036854775807 - -1 --- +int(-9223372036854775806) +--- testing: -9223372036854775807 - 7 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775807 - 9 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775807 - 65 --- +float(-9.2233720368548E+18) +--- testing: -9223372036854775807 - -44 --- +int(-9223372036854775763) +--- testing: -9223372036854775807 - 2147483647 --- +float(-9.2233720390023E+18) +--- testing: -9223372036854775807 - 9223372036854775807 --- +float(-1.844674407371E+19) +--- testing: -9.2233720368548E+18 - 0 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - 1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - -1 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - 7 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - 9 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - 65 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - -44 --- +float(-9.2233720368548E+18) +--- testing: -9.2233720368548E+18 - 2147483647 --- +float(-9.2233720390023E+18) +--- testing: -9.2233720368548E+18 - 9223372036854775807 --- +float(-1.844674407371E+19) +--- testing: 0 - 9223372036854775807 --- +int(-9223372036854775807) +--- testing: 0 - -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 0 - 2147483647 --- +int(-2147483647) +--- testing: 0 - -2147483648 --- +int(2147483648) +--- testing: 0 - 9223372034707292160 --- +int(-9223372034707292160) +--- testing: 0 - -9223372034707292160 --- +int(9223372034707292160) +--- testing: 0 - 2147483648 --- +int(-2147483648) +--- testing: 0 - -2147483649 --- +int(2147483649) +--- testing: 0 - 4294967294 --- +int(-4294967294) +--- testing: 0 - 4294967295 --- +int(-4294967295) +--- testing: 0 - 4294967293 --- +int(-4294967293) +--- testing: 0 - 9223372036854775806 --- +int(-9223372036854775806) +--- testing: 0 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 0 - -9223372036854775807 --- +int(9223372036854775807) +--- testing: 0 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 1 - 9223372036854775807 --- +int(-9223372036854775806) +--- testing: 1 - -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 1 - 2147483647 --- +int(-2147483646) +--- testing: 1 - -2147483648 --- +int(2147483649) +--- testing: 1 - 9223372034707292160 --- +int(-9223372034707292159) +--- testing: 1 - -9223372034707292160 --- +int(9223372034707292161) +--- testing: 1 - 2147483648 --- +int(-2147483647) +--- testing: 1 - -2147483649 --- +int(2147483650) +--- testing: 1 - 4294967294 --- +int(-4294967293) +--- testing: 1 - 4294967295 --- +int(-4294967294) +--- testing: 1 - 4294967293 --- +int(-4294967292) +--- testing: 1 - 9223372036854775806 --- +int(-9223372036854775805) +--- testing: 1 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 1 - -9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 1 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -1 - 9223372036854775807 --- +int(-9223372036854775808) +--- testing: -1 - -9223372036854775808 --- +int(9223372036854775807) +--- testing: -1 - 2147483647 --- +int(-2147483648) +--- testing: -1 - -2147483648 --- +int(2147483647) +--- testing: -1 - 9223372034707292160 --- +int(-9223372034707292161) +--- testing: -1 - -9223372034707292160 --- +int(9223372034707292159) +--- testing: -1 - 2147483648 --- +int(-2147483649) +--- testing: -1 - -2147483649 --- +int(2147483648) +--- testing: -1 - 4294967294 --- +int(-4294967295) +--- testing: -1 - 4294967295 --- +int(-4294967296) +--- testing: -1 - 4294967293 --- +int(-4294967294) +--- testing: -1 - 9223372036854775806 --- +int(-9223372036854775807) +--- testing: -1 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -1 - -9223372036854775807 --- +int(9223372036854775806) +--- testing: -1 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 7 - 9223372036854775807 --- +int(-9223372036854775800) +--- testing: 7 - -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 7 - 2147483647 --- +int(-2147483640) +--- testing: 7 - -2147483648 --- +int(2147483655) +--- testing: 7 - 9223372034707292160 --- +int(-9223372034707292153) +--- testing: 7 - -9223372034707292160 --- +int(9223372034707292167) +--- testing: 7 - 2147483648 --- +int(-2147483641) +--- testing: 7 - -2147483649 --- +int(2147483656) +--- testing: 7 - 4294967294 --- +int(-4294967287) +--- testing: 7 - 4294967295 --- +int(-4294967288) +--- testing: 7 - 4294967293 --- +int(-4294967286) +--- testing: 7 - 9223372036854775806 --- +int(-9223372036854775799) +--- testing: 7 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 7 - -9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 7 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 9 - 9223372036854775807 --- +int(-9223372036854775798) +--- testing: 9 - -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 9 - 2147483647 --- +int(-2147483638) +--- testing: 9 - -2147483648 --- +int(2147483657) +--- testing: 9 - 9223372034707292160 --- +int(-9223372034707292151) +--- testing: 9 - -9223372034707292160 --- +int(9223372034707292169) +--- testing: 9 - 2147483648 --- +int(-2147483639) +--- testing: 9 - -2147483649 --- +int(2147483658) +--- testing: 9 - 4294967294 --- +int(-4294967285) +--- testing: 9 - 4294967295 --- +int(-4294967286) +--- testing: 9 - 4294967293 --- +int(-4294967284) +--- testing: 9 - 9223372036854775806 --- +int(-9223372036854775797) +--- testing: 9 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 9 - -9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 9 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 65 - 9223372036854775807 --- +int(-9223372036854775742) +--- testing: 65 - -9223372036854775808 --- +float(9.2233720368548E+18) +--- testing: 65 - 2147483647 --- +int(-2147483582) +--- testing: 65 - -2147483648 --- +int(2147483713) +--- testing: 65 - 9223372034707292160 --- +int(-9223372034707292095) +--- testing: 65 - -9223372034707292160 --- +int(9223372034707292225) +--- testing: 65 - 2147483648 --- +int(-2147483583) +--- testing: 65 - -2147483649 --- +int(2147483714) +--- testing: 65 - 4294967294 --- +int(-4294967229) +--- testing: 65 - 4294967295 --- +int(-4294967230) +--- testing: 65 - 4294967293 --- +int(-4294967228) +--- testing: 65 - 9223372036854775806 --- +int(-9223372036854775741) +--- testing: 65 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: 65 - -9223372036854775807 --- +float(9.2233720368548E+18) +--- testing: 65 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: -44 - 9223372036854775807 --- +float(-9.2233720368548E+18) +--- testing: -44 - -9223372036854775808 --- +int(9223372036854775764) +--- testing: -44 - 2147483647 --- +int(-2147483691) +--- testing: -44 - -2147483648 --- +int(2147483604) +--- testing: -44 - 9223372034707292160 --- +int(-9223372034707292204) +--- testing: -44 - -9223372034707292160 --- +int(9223372034707292116) +--- testing: -44 - 2147483648 --- +int(-2147483692) +--- testing: -44 - -2147483649 --- +int(2147483605) +--- testing: -44 - 4294967294 --- +int(-4294967338) +--- testing: -44 - 4294967295 --- +int(-4294967339) +--- testing: -44 - 4294967293 --- +int(-4294967337) +--- testing: -44 - 9223372036854775806 --- +float(-9.2233720368548E+18) +--- testing: -44 - 9.2233720368548E+18 --- +float(-9.2233720368548E+18) +--- testing: -44 - -9223372036854775807 --- +int(9223372036854775763) +--- testing: -44 - -9.2233720368548E+18 --- +float(9.2233720368548E+18) +--- testing: 2147483647 - 9223372036854775807 --- +int(-9223372034707292160) +--- testing: 2147483647 - -9223372036854775808 --- +float(9.2233720390023E+18) +--- testing: 2147483647 - 2147483647 --- +int(0) +--- testing: 2147483647 - -2147483648 --- +int(4294967295) +--- testing: 2147483647 - 9223372034707292160 --- +int(-9223372032559808513) +--- testing: 2147483647 - -9223372034707292160 --- +int(9223372036854775807) +--- testing: 2147483647 - 2147483648 --- +int(-1) +--- testing: 2147483647 - -2147483649 --- +int(4294967296) +--- testing: 2147483647 - 4294967294 --- +int(-2147483647) +--- testing: 2147483647 - 4294967295 --- +int(-2147483648) +--- testing: 2147483647 - 4294967293 --- +int(-2147483646) +--- testing: 2147483647 - 9223372036854775806 --- +int(-9223372034707292159) +--- testing: 2147483647 - 9.2233720368548E+18 --- +float(-9.2233720347073E+18) +--- testing: 2147483647 - -9223372036854775807 --- +float(9.2233720390023E+18) +--- testing: 2147483647 - -9.2233720368548E+18 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 - 9223372036854775807 --- +int(0) +--- testing: 9223372036854775807 - -9223372036854775808 --- +float(1.844674407371E+19) +--- testing: 9223372036854775807 - 2147483647 --- +int(9223372034707292160) +--- testing: 9223372036854775807 - -2147483648 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 - 9223372034707292160 --- +int(2147483647) +--- testing: 9223372036854775807 - -9223372034707292160 --- +float(1.8446744071562E+19) +--- testing: 9223372036854775807 - 2147483648 --- +int(9223372034707292159) +--- testing: 9223372036854775807 - -2147483649 --- +float(9.2233720390023E+18) +--- testing: 9223372036854775807 - 4294967294 --- +int(9223372032559808513) +--- testing: 9223372036854775807 - 4294967295 --- +int(9223372032559808512) +--- testing: 9223372036854775807 - 4294967293 --- +int(9223372032559808514) +--- testing: 9223372036854775807 - 9223372036854775806 --- +int(1) +--- testing: 9223372036854775807 - 9.2233720368548E+18 --- +float(0) +--- testing: 9223372036854775807 - -9223372036854775807 --- +float(1.844674407371E+19) +--- testing: 9223372036854775807 - -9.2233720368548E+18 --- +float(1.844674407371E+19) +===DONE=== diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt new file mode 100644 index 0000000..5b5bae2 --- /dev/null +++ b/tests/lang/operators/subtract_variationStr.phpt @@ -0,0 +1,416 @@ +--TEST-- +Test - operator : various numbers as strings +--FILE-- + +===DONE=== +--EXPECT-- +--- testing: '0' - '0' --- +int(0) +--- testing: '0' - '65' --- +int(-65) +--- testing: '0' - '-44' --- +int(44) +--- testing: '0' - '1.2' --- +float(-1.2) +--- testing: '0' - '-7.7' --- +float(7.7) +--- testing: '0' - 'abc' --- +int(0) +--- testing: '0' - '123abc' --- +int(-123) +--- testing: '0' - '123e5' --- +float(-12300000) +--- testing: '0' - '123e5xyz' --- +float(-12300000) +--- testing: '0' - ' 123abc' --- +int(-123) +--- testing: '0' - '123 abc' --- +int(-123) +--- testing: '0' - '123abc ' --- +int(-123) +--- testing: '0' - '3.4a' --- +float(-3.4) +--- testing: '0' - 'a5.9' --- +int(0) +--- testing: '65' - '0' --- +int(65) +--- testing: '65' - '65' --- +int(0) +--- testing: '65' - '-44' --- +int(109) +--- testing: '65' - '1.2' --- +float(63.8) +--- testing: '65' - '-7.7' --- +float(72.7) +--- testing: '65' - 'abc' --- +int(65) +--- testing: '65' - '123abc' --- +int(-58) +--- testing: '65' - '123e5' --- +float(-12299935) +--- testing: '65' - '123e5xyz' --- +float(-12299935) +--- testing: '65' - ' 123abc' --- +int(-58) +--- testing: '65' - '123 abc' --- +int(-58) +--- testing: '65' - '123abc ' --- +int(-58) +--- testing: '65' - '3.4a' --- +float(61.6) +--- testing: '65' - 'a5.9' --- +int(65) +--- testing: '-44' - '0' --- +int(-44) +--- testing: '-44' - '65' --- +int(-109) +--- testing: '-44' - '-44' --- +int(0) +--- testing: '-44' - '1.2' --- +float(-45.2) +--- testing: '-44' - '-7.7' --- +float(-36.3) +--- testing: '-44' - 'abc' --- +int(-44) +--- testing: '-44' - '123abc' --- +int(-167) +--- testing: '-44' - '123e5' --- +float(-12300044) +--- testing: '-44' - '123e5xyz' --- +float(-12300044) +--- testing: '-44' - ' 123abc' --- +int(-167) +--- testing: '-44' - '123 abc' --- +int(-167) +--- testing: '-44' - '123abc ' --- +int(-167) +--- testing: '-44' - '3.4a' --- +float(-47.4) +--- testing: '-44' - 'a5.9' --- +int(-44) +--- testing: '1.2' - '0' --- +float(1.2) +--- testing: '1.2' - '65' --- +float(-63.8) +--- testing: '1.2' - '-44' --- +float(45.2) +--- testing: '1.2' - '1.2' --- +float(0) +--- testing: '1.2' - '-7.7' --- +float(8.9) +--- testing: '1.2' - 'abc' --- +float(1.2) +--- testing: '1.2' - '123abc' --- +float(-121.8) +--- testing: '1.2' - '123e5' --- +float(-12299998.8) +--- testing: '1.2' - '123e5xyz' --- +float(-12299998.8) +--- testing: '1.2' - ' 123abc' --- +float(-121.8) +--- testing: '1.2' - '123 abc' --- +float(-121.8) +--- testing: '1.2' - '123abc ' --- +float(-121.8) +--- testing: '1.2' - '3.4a' --- +float(-2.2) +--- testing: '1.2' - 'a5.9' --- +float(1.2) +--- testing: '-7.7' - '0' --- +float(-7.7) +--- testing: '-7.7' - '65' --- +float(-72.7) +--- testing: '-7.7' - '-44' --- +float(36.3) +--- testing: '-7.7' - '1.2' --- +float(-8.9) +--- testing: '-7.7' - '-7.7' --- +float(0) +--- testing: '-7.7' - 'abc' --- +float(-7.7) +--- testing: '-7.7' - '123abc' --- +float(-130.7) +--- testing: '-7.7' - '123e5' --- +float(-12300007.7) +--- testing: '-7.7' - '123e5xyz' --- +float(-12300007.7) +--- testing: '-7.7' - ' 123abc' --- +float(-130.7) +--- testing: '-7.7' - '123 abc' --- +float(-130.7) +--- testing: '-7.7' - '123abc ' --- +float(-130.7) +--- testing: '-7.7' - '3.4a' --- +float(-11.1) +--- testing: '-7.7' - 'a5.9' --- +float(-7.7) +--- testing: 'abc' - '0' --- +int(0) +--- testing: 'abc' - '65' --- +int(-65) +--- testing: 'abc' - '-44' --- +int(44) +--- testing: 'abc' - '1.2' --- +float(-1.2) +--- testing: 'abc' - '-7.7' --- +float(7.7) +--- testing: 'abc' - 'abc' --- +int(0) +--- testing: 'abc' - '123abc' --- +int(-123) +--- testing: 'abc' - '123e5' --- +float(-12300000) +--- testing: 'abc' - '123e5xyz' --- +float(-12300000) +--- testing: 'abc' - ' 123abc' --- +int(-123) +--- testing: 'abc' - '123 abc' --- +int(-123) +--- testing: 'abc' - '123abc ' --- +int(-123) +--- testing: 'abc' - '3.4a' --- +float(-3.4) +--- testing: 'abc' - 'a5.9' --- +int(0) +--- testing: '123abc' - '0' --- +int(123) +--- testing: '123abc' - '65' --- +int(58) +--- testing: '123abc' - '-44' --- +int(167) +--- testing: '123abc' - '1.2' --- +float(121.8) +--- testing: '123abc' - '-7.7' --- +float(130.7) +--- testing: '123abc' - 'abc' --- +int(123) +--- testing: '123abc' - '123abc' --- +int(0) +--- testing: '123abc' - '123e5' --- +float(-12299877) +--- testing: '123abc' - '123e5xyz' --- +float(-12299877) +--- testing: '123abc' - ' 123abc' --- +int(0) +--- testing: '123abc' - '123 abc' --- +int(0) +--- testing: '123abc' - '123abc ' --- +int(0) +--- testing: '123abc' - '3.4a' --- +float(119.6) +--- testing: '123abc' - 'a5.9' --- +int(123) +--- testing: '123e5' - '0' --- +float(12300000) +--- testing: '123e5' - '65' --- +float(12299935) +--- testing: '123e5' - '-44' --- +float(12300044) +--- testing: '123e5' - '1.2' --- +float(12299998.8) +--- testing: '123e5' - '-7.7' --- +float(12300007.7) +--- testing: '123e5' - 'abc' --- +float(12300000) +--- testing: '123e5' - '123abc' --- +float(12299877) +--- testing: '123e5' - '123e5' --- +float(0) +--- testing: '123e5' - '123e5xyz' --- +float(0) +--- testing: '123e5' - ' 123abc' --- +float(12299877) +--- testing: '123e5' - '123 abc' --- +float(12299877) +--- testing: '123e5' - '123abc ' --- +float(12299877) +--- testing: '123e5' - '3.4a' --- +float(12299996.6) +--- testing: '123e5' - 'a5.9' --- +float(12300000) +--- testing: '123e5xyz' - '0' --- +float(12300000) +--- testing: '123e5xyz' - '65' --- +float(12299935) +--- testing: '123e5xyz' - '-44' --- +float(12300044) +--- testing: '123e5xyz' - '1.2' --- +float(12299998.8) +--- testing: '123e5xyz' - '-7.7' --- +float(12300007.7) +--- testing: '123e5xyz' - 'abc' --- +float(12300000) +--- testing: '123e5xyz' - '123abc' --- +float(12299877) +--- testing: '123e5xyz' - '123e5' --- +float(0) +--- testing: '123e5xyz' - '123e5xyz' --- +float(0) +--- testing: '123e5xyz' - ' 123abc' --- +float(12299877) +--- testing: '123e5xyz' - '123 abc' --- +float(12299877) +--- testing: '123e5xyz' - '123abc ' --- +float(12299877) +--- testing: '123e5xyz' - '3.4a' --- +float(12299996.6) +--- testing: '123e5xyz' - 'a5.9' --- +float(12300000) +--- testing: ' 123abc' - '0' --- +int(123) +--- testing: ' 123abc' - '65' --- +int(58) +--- testing: ' 123abc' - '-44' --- +int(167) +--- testing: ' 123abc' - '1.2' --- +float(121.8) +--- testing: ' 123abc' - '-7.7' --- +float(130.7) +--- testing: ' 123abc' - 'abc' --- +int(123) +--- testing: ' 123abc' - '123abc' --- +int(0) +--- testing: ' 123abc' - '123e5' --- +float(-12299877) +--- testing: ' 123abc' - '123e5xyz' --- +float(-12299877) +--- testing: ' 123abc' - ' 123abc' --- +int(0) +--- testing: ' 123abc' - '123 abc' --- +int(0) +--- testing: ' 123abc' - '123abc ' --- +int(0) +--- testing: ' 123abc' - '3.4a' --- +float(119.6) +--- testing: ' 123abc' - 'a5.9' --- +int(123) +--- testing: '123 abc' - '0' --- +int(123) +--- testing: '123 abc' - '65' --- +int(58) +--- testing: '123 abc' - '-44' --- +int(167) +--- testing: '123 abc' - '1.2' --- +float(121.8) +--- testing: '123 abc' - '-7.7' --- +float(130.7) +--- testing: '123 abc' - 'abc' --- +int(123) +--- testing: '123 abc' - '123abc' --- +int(0) +--- testing: '123 abc' - '123e5' --- +float(-12299877) +--- testing: '123 abc' - '123e5xyz' --- +float(-12299877) +--- testing: '123 abc' - ' 123abc' --- +int(0) +--- testing: '123 abc' - '123 abc' --- +int(0) +--- testing: '123 abc' - '123abc ' --- +int(0) +--- testing: '123 abc' - '3.4a' --- +float(119.6) +--- testing: '123 abc' - 'a5.9' --- +int(123) +--- testing: '123abc ' - '0' --- +int(123) +--- testing: '123abc ' - '65' --- +int(58) +--- testing: '123abc ' - '-44' --- +int(167) +--- testing: '123abc ' - '1.2' --- +float(121.8) +--- testing: '123abc ' - '-7.7' --- +float(130.7) +--- testing: '123abc ' - 'abc' --- +int(123) +--- testing: '123abc ' - '123abc' --- +int(0) +--- testing: '123abc ' - '123e5' --- +float(-12299877) +--- testing: '123abc ' - '123e5xyz' --- +float(-12299877) +--- testing: '123abc ' - ' 123abc' --- +int(0) +--- testing: '123abc ' - '123 abc' --- +int(0) +--- testing: '123abc ' - '123abc ' --- +int(0) +--- testing: '123abc ' - '3.4a' --- +float(119.6) +--- testing: '123abc ' - 'a5.9' --- +int(123) +--- testing: '3.4a' - '0' --- +float(3.4) +--- testing: '3.4a' - '65' --- +float(-61.6) +--- testing: '3.4a' - '-44' --- +float(47.4) +--- testing: '3.4a' - '1.2' --- +float(2.2) +--- testing: '3.4a' - '-7.7' --- +float(11.1) +--- testing: '3.4a' - 'abc' --- +float(3.4) +--- testing: '3.4a' - '123abc' --- +float(-119.6) +--- testing: '3.4a' - '123e5' --- +float(-12299996.6) +--- testing: '3.4a' - '123e5xyz' --- +float(-12299996.6) +--- testing: '3.4a' - ' 123abc' --- +float(-119.6) +--- testing: '3.4a' - '123 abc' --- +float(-119.6) +--- testing: '3.4a' - '123abc ' --- +float(-119.6) +--- testing: '3.4a' - '3.4a' --- +float(0) +--- testing: '3.4a' - 'a5.9' --- +float(3.4) +--- testing: 'a5.9' - '0' --- +int(0) +--- testing: 'a5.9' - '65' --- +int(-65) +--- testing: 'a5.9' - '-44' --- +int(44) +--- testing: 'a5.9' - '1.2' --- +float(-1.2) +--- testing: 'a5.9' - '-7.7' --- +float(7.7) +--- testing: 'a5.9' - 'abc' --- +int(0) +--- testing: 'a5.9' - '123abc' --- +int(-123) +--- testing: 'a5.9' - '123e5' --- +float(-12300000) +--- testing: 'a5.9' - '123e5xyz' --- +float(-12300000) +--- testing: 'a5.9' - ' 123abc' --- +int(-123) +--- testing: 'a5.9' - '123 abc' --- +int(-123) +--- testing: 'a5.9' - '123abc ' --- +int(-123) +--- testing: 'a5.9' - '3.4a' --- +float(-3.4) +--- testing: 'a5.9' - 'a5.9' --- +int(0) +===DONE=== diff --git a/tests/lang/passByReference_001.phpt b/tests/lang/passByReference_001.phpt new file mode 100644 index 0000000..c73eacc --- /dev/null +++ b/tests/lang/passByReference_001.phpt @@ -0,0 +1,37 @@ +--TEST-- +passing of function parameters by reference +--FILE-- + +--EXPECT-- +int(7) +int(15) +int(7) +int(16) +array(1) { + [0]=> + &int(1) +} +int(1) \ No newline at end of file diff --git a/tests/lang/passByReference_002.phpt b/tests/lang/passByReference_002.phpt new file mode 100644 index 0000000..d1968a3 --- /dev/null +++ b/tests/lang/passByReference_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +Attempt to pass a constant by reference +--FILE-- + +--EXPECTF-- +Fatal error: Only variables can be passed by reference in %s on line 8 diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt new file mode 100644 index 0000000..bbbc564 --- /dev/null +++ b/tests/lang/passByReference_003.phpt @@ -0,0 +1,48 @@ +--TEST-- +Implicit initialisation when passing by reference +--FILE-- + +--EXPECTF-- + +Passing undefined by value + +Notice: Undefined variable: undef1 in %s on line 13 + +Inside passbyVal call: +NULL + +After call + +Notice: Undefined variable: undef1 in %s on line 15 +NULL + +Passing undefined by reference + +Inside passbyRef call: +NULL + +After call +array(1) { + [0]=> + NULL +} diff --git a/tests/lang/passByReference_004.phpt b/tests/lang/passByReference_004.phpt new file mode 100644 index 0000000..e8a7963 --- /dev/null +++ b/tests/lang/passByReference_004.phpt @@ -0,0 +1,21 @@ +--TEST-- +passing the return value from a function by reference +--FILE-- + +--EXPECTF-- +Strict Standards: Only variables should be passed by reference in %s on line 13 +int(5) diff --git a/tests/lang/passByReference_005.phpt b/tests/lang/passByReference_005.phpt new file mode 100644 index 0000000..52ddeeb --- /dev/null +++ b/tests/lang/passByReference_005.phpt @@ -0,0 +1,261 @@ +--TEST-- +Pass uninitialised variables by reference and by value to test implicit initialisation. +--FILE-- +v($u1); +$c->r($u2); +var_dump($u1, $u2); + +unset($u1, $u2); +$c->vv($u1, $u2); +var_dump($u1, $u2); + +unset($u1, $u2); +$c->vr($u1, $u2); +var_dump($u1, $u2); + +unset($u1, $u2); +$c->rv($u1, $u2); +var_dump($u1, $u2); + +unset($u1, $u2); +$c->rr($u1, $u2); +var_dump($u1, $u2); + +?> +--EXPECTF-- + + ---- Pass by ref / pass by val: functions ---- + +Notice: Undefined variable: u1 in %s on line 72 + +Notice: Undefined variable: u1 in %s on line 74 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u1 in %s on line 77 + +Notice: Undefined variable: u2 in %s on line 77 + +Notice: Undefined variable: u1 in %s on line 78 + +Notice: Undefined variable: u2 in %s on line 78 +NULL +NULL + +Notice: Undefined variable: u1 in %s on line 81 + +Notice: Undefined variable: u1 in %s on line 82 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u2 in %s on line 85 + +Notice: Undefined variable: u2 in %s on line 86 +string(11) "Ref changed" +NULL +string(12) "Ref1 changed" +string(12) "Ref2 changed" + + + ---- Pass by ref / pass by val: static method calls ---- + +Notice: Undefined variable: u1 in %s on line 95 + +Strict Standards: Non-static method C::v() should not be called statically in %s on line 95 + +Strict Standards: Non-static method C::r() should not be called statically in %s on line 96 + +Notice: Undefined variable: u1 in %s on line 97 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u1 in %s on line 100 + +Notice: Undefined variable: u2 in %s on line 100 + +Strict Standards: Non-static method C::vv() should not be called statically in %s on line 100 + +Notice: Undefined variable: u1 in %s on line 101 + +Notice: Undefined variable: u2 in %s on line 101 +NULL +NULL + +Notice: Undefined variable: u1 in %s on line 104 + +Strict Standards: Non-static method C::vr() should not be called statically in %s on line 104 + +Notice: Undefined variable: u1 in %s on line 105 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u2 in %s on line 108 + +Strict Standards: Non-static method C::rv() should not be called statically in %s on line 108 + +Notice: Undefined variable: u2 in %s on line 109 +string(11) "Ref changed" +NULL + +Strict Standards: Non-static method C::rr() should not be called statically in %s on line 112 +string(12) "Ref1 changed" +string(12) "Ref2 changed" + + + ---- Pass by ref / pass by val: instance method calls ---- + +Notice: Undefined variable: u1 in %s on line 117 + +Notice: Undefined variable: u1 in %s on line 118 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u1 in %s on line 121 + +Notice: Undefined variable: u1 in %s on line 123 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u1 in %s on line 126 + +Notice: Undefined variable: u2 in %s on line 126 + +Notice: Undefined variable: u1 in %s on line 127 + +Notice: Undefined variable: u2 in %s on line 127 +NULL +NULL + +Notice: Undefined variable: u1 in %s on line 130 + +Notice: Undefined variable: u1 in %s on line 131 +NULL +string(11) "Ref changed" + +Notice: Undefined variable: u2 in %s on line 134 + +Notice: Undefined variable: u2 in %s on line 135 +string(11) "Ref changed" +NULL +string(12) "Ref1 changed" +string(12) "Ref2 changed" \ No newline at end of file diff --git a/tests/lang/passByReference_006.phpt b/tests/lang/passByReference_006.phpt new file mode 100644 index 0000000..248be88 --- /dev/null +++ b/tests/lang/passByReference_006.phpt @@ -0,0 +1,195 @@ +--TEST-- +Pass uninitialised objects and arrays by reference to test implicit initialisation. +--FILE-- +a, $u4->a->b, $u5->a->b->c); +var_dump($u1, $u2, $u3, $u4, $u5); + +echo "\n ---- Pass uninitialised arrays & objects by ref: static method call ---\n"; +unset($u1, $u2, $u3, $u4, $u5); +C::refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); +var_dump($u1, $u2, $u3, $u4, $u5); + +echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n"; +unset($u1, $u2, $u3, $u4, $u5); +$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); +var_dump($u1, $u2, $u3, $u4, $u5); + +echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call ---\n"; +unset($u1, $u2, $u3, $u4, $u5); +$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c); +var_dump($u1, $u2, $u3, $u4, $u5); + +?> +--EXPECTF-- + + ---- Pass uninitialised array & object by ref: function call --- +array(1) { + [0]=> + string(12) "Ref1 changed" +} +array(1) { + [0]=> + array(1) { + [1]=> + string(12) "Ref2 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + string(12) "Ref3 changed" +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + string(12) "Ref4 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + object(stdClass)#%d (1) { + ["c"]=> + string(12) "Ref5 changed" + } + } +} + + ---- Pass uninitialised arrays & objects by ref: static method call --- + +Strict Standards: Non-static method C::refs() should not be called statically in %s on line 39 +array(1) { + [0]=> + string(12) "Ref1 changed" +} +array(1) { + [0]=> + array(1) { + [1]=> + string(12) "Ref2 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + string(12) "Ref3 changed" +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + string(12) "Ref4 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + object(stdClass)#%d (1) { + ["c"]=> + string(12) "Ref5 changed" + } + } +} + + +---- Pass uninitialised arrays & objects by ref: constructor --- +array(1) { + [0]=> + string(12) "Ref1 changed" +} +array(1) { + [0]=> + array(1) { + [1]=> + string(12) "Ref2 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + string(12) "Ref3 changed" +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + string(12) "Ref4 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + object(stdClass)#%d (1) { + ["c"]=> + string(12) "Ref5 changed" + } + } +} + + ---- Pass uninitialised arrays & objects by ref: instance method call --- +array(1) { + [0]=> + string(12) "Ref1 changed" +} +array(1) { + [0]=> + array(1) { + [1]=> + string(12) "Ref2 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + string(12) "Ref3 changed" +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + string(12) "Ref4 changed" + } +} +object(stdClass)#%d (1) { + ["a"]=> + object(stdClass)#%d (1) { + ["b"]=> + object(stdClass)#%d (1) { + ["c"]=> + string(12) "Ref5 changed" + } + } +} \ No newline at end of file diff --git a/tests/lang/passByReference_007.phpt b/tests/lang/passByReference_007.phpt new file mode 100644 index 0000000..558ceae --- /dev/null +++ b/tests/lang/passByReference_007.phpt @@ -0,0 +1,105 @@ +--TEST-- +Pass function and method calls by reference and by value. +--FILE-- +returnVal()); +var_dump($a); + +echo "Pass a method call that returns a reference:\n"; +$a = "original"; +foo($myC->returnReference()); +var_dump($a); + +?> +--EXPECTF-- +Pass a function call that returns a value: + +Strict Standards: Only variables should be passed by reference in %s on line 44 +string(8) "original" +string(8) "original" +Pass a function call that returns a reference: +string(8) "original" +string(7) "changed" + +Pass a static method call that returns a value: + +Strict Standards: Only variables should be passed by reference in %s on line 55 +string(8) "original" +string(8) "original" +Pass a static method call that returns a reference: +string(8) "original" +string(7) "changed" + +Pass a method call that returns a value: + +Strict Standards: Only variables should be passed by reference in %s on line 67 +string(8) "original" +string(8) "original" +Pass a method call that returns a reference: +string(8) "original" +string(7) "changed" \ No newline at end of file diff --git a/tests/lang/passByReference_008.phpt b/tests/lang/passByReference_008.phpt new file mode 100644 index 0000000..3685217 --- /dev/null +++ b/tests/lang/passByReference_008.phpt @@ -0,0 +1,40 @@ +--TEST-- +Pass same variable by ref and by value. +--FILE-- + +--EXPECTF-- + + +-- Val, Ref -- +string(10) "original.a" +string(10) "original.a" +string(9) "changed.y" + + +-- Ref, Val -- +string(10) "original.b" +string(10) "original.b" +string(9) "changed.x" \ No newline at end of file diff --git a/tests/lang/passByReference_009.phpt b/tests/lang/passByReference_009.phpt new file mode 100644 index 0000000..1cbd87d --- /dev/null +++ b/tests/lang/passByReference_009.phpt @@ -0,0 +1,24 @@ +--TEST-- +Assignement as argument +--FILE-- + +--EXPECTF-- +1012 \ No newline at end of file diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt new file mode 100644 index 0000000..0393cce --- /dev/null +++ b/tests/lang/passByReference_010.phpt @@ -0,0 +1,61 @@ +--TEST-- +Passing assignments by reference +--FILE-- + Pass constant assignment by reference:\n"; +f($a="a.original"); +var_dump($a); + +echo "\n\n---> Pass variable assignment by reference:\n"; +unset($a); +$a = "a.original"; +f($b = $a); +var_dump($a); + +echo "\n\n---> Pass reference assignment by reference:\n"; +unset($a, $b); +$a = "a.original"; +f($b =& $a); +var_dump($a); + +echo "\n\n---> Pass concat assignment by reference:\n"; +unset($a, $b); +$b = "b.original"; +$a = "a.original"; +f($b .= $a); +var_dump($a); + +?> +--EXPECTF-- + + +---> Pass constant assignment by reference: + +Strict Standards: Only variables should be passed by reference in %s on line 9 +string(10) "a.original" +string(10) "a.original" + + +---> Pass variable assignment by reference: + +Strict Standards: Only variables should be passed by reference in %s on line 15 +string(10) "a.original" +string(10) "a.original" + + +---> Pass reference assignment by reference: +string(10) "a.original" +string(9) "a.changed" + + +---> Pass concat assignment by reference: + +Strict Standards: Only variables should be passed by reference in %s on line 28 +string(20) "b.originala.original" +string(10) "a.original" diff --git a/tests/lang/passByReference_012.phpt b/tests/lang/passByReference_012.phpt new file mode 100644 index 0000000..c6ce705 --- /dev/null +++ b/tests/lang/passByReference_012.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test pass by reference semantics +--FILE-- + +===DONE=== +--EXPECTF-- +Strict Standards: Only variables should be passed by reference in %s on line %d +string(3) "two" + +Strict Standards: Only variables should be passed by reference in %s on line %d +string(3) "one" +===DONE=== diff --git a/tests/lang/returnByReference.001.phpt b/tests/lang/returnByReference.001.phpt new file mode 100644 index 0000000..4abc3c7 --- /dev/null +++ b/tests/lang/returnByReference.001.phpt @@ -0,0 +1,20 @@ +--TEST-- +Returning a reference from a function +--FILE-- + +--EXPECT-- +int(7) +int(8) \ No newline at end of file diff --git a/tests/lang/returnByReference.002.phpt b/tests/lang/returnByReference.002.phpt new file mode 100644 index 0000000..3494eb5 --- /dev/null +++ b/tests/lang/returnByReference.002.phpt @@ -0,0 +1,29 @@ +--TEST-- +Returning a reference from a function. +--FILE-- + +--EXPECTF-- + +Strict Standards: Only variables should be assigned by reference in %s on line 13 +string(8) "original" +string(7) "changed" diff --git a/tests/lang/returnByReference.003.phpt b/tests/lang/returnByReference.003.phpt new file mode 100644 index 0000000..04a6338 --- /dev/null +++ b/tests/lang/returnByReference.003.phpt @@ -0,0 +1,55 @@ +--TEST-- +Returning a reference from a function +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Strict Standards: Only variables should be assigned by reference in %s on line 17 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 7 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.004.phpt b/tests/lang/returnByReference.004.phpt new file mode 100644 index 0000000..f185c12 --- /dev/null +++ b/tests/lang/returnByReference.004.phpt @@ -0,0 +1,57 @@ +--TEST-- +Returning a reference from a static method +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Strict Standards: Only variables should be assigned by reference in %s on line 19 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.005.phpt b/tests/lang/returnByReference.005.phpt new file mode 100644 index 0000000..a7b6da2 --- /dev/null +++ b/tests/lang/returnByReference.005.phpt @@ -0,0 +1,58 @@ +--TEST-- +Returning a reference from a method +--FILE-- + 1. Trying to assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnConstantByValue(); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnConstantByRef(); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnVariableByRef(); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Trying to assign by reference the return value of a function that returns by value: + +Strict Standards: Only variables should be assigned by reference in %s on line 20 +int(5) +int(100) + +---> 2. Trying to assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Trying to assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.006.phpt b/tests/lang/returnByReference.006.phpt new file mode 100644 index 0000000..4019f3a --- /dev/null +++ b/tests/lang/returnByReference.006.phpt @@ -0,0 +1,60 @@ +--TEST-- +Returning a reference from a function via another function +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- + 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 15 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 7 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) +int(5) diff --git a/tests/lang/returnByReference.007.phpt b/tests/lang/returnByReference.007.phpt new file mode 100644 index 0000000..1247e55 --- /dev/null +++ b/tests/lang/returnByReference.007.phpt @@ -0,0 +1,63 @@ +--TEST-- +Returning a reference from a static method via another static method +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- + 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &C::returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 16 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) +int(5) \ No newline at end of file diff --git a/tests/lang/returnByReference.008.phpt b/tests/lang/returnByReference.008.phpt new file mode 100644 index 0000000..d595de2 --- /dev/null +++ b/tests/lang/returnByReference.008.phpt @@ -0,0 +1,64 @@ +--TEST-- +Returning a reference from a non-static method via another non-static method +--INI-- +error_reporting = E_ALL & ~E_STRICT +--FILE-- +$functionToCall(); + } +} +$c = new C; + +echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnConstantByValue'); +$a++; +var_dump($a, $b); + +echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnConstantByRef'); +$a++; +var_dump($a, $b); + +echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n"; +unset($a, $b); +$a = 4; +$b = &$c->returnFunctionCallByRef('returnVariableByRef'); +$a++; +var_dump($a, $b); + +?> +--EXPECTF-- + +---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value: + +Notice: Only variable references should be returned by reference in %s on line 16 +int(5) +int(100) + +---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref: + +Notice: Only variable references should be returned by reference in %s on line 8 +int(5) +int(100) + +---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref: +int(5) +int(5) \ No newline at end of file diff --git a/tests/lang/returnByReference.009.phpt b/tests/lang/returnByReference.009.phpt new file mode 100644 index 0000000..6320375 --- /dev/null +++ b/tests/lang/returnByReference.009.phpt @@ -0,0 +1,39 @@ +--TEST-- +Returning a references returned by another function +--FILE-- + 1. Return a variable by reference -> No warning:\n"; + +var_dump (testReturnVarByRef()); + +echo "\n---> 2. Return a value by reference -> Warning:\n"; + +var_dump (testReturnValByRef()); + +--EXPECTF-- +---> 1. Return a variable by reference -> No warning: +int(1) + +---> 2. Return a value by reference -> Warning: + +Notice: Only variable references should be returned by reference in %s on line %d +int(1) diff --git a/tests/lang/script_tag.phpt b/tests/lang/script_tag.phpt new file mode 100644 index 0000000..1b5c696 --- /dev/null +++ b/tests/lang/script_tag.phpt @@ -0,0 +1,17 @@ +--TEST-- + + + +texto